+2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/69544
+ PR fortran/78178
+ * match.c (match_simple_where): Fill in locus for assigment
+ in simple WHERE statement.
+ (gfc_match_where): Likewise.
+
2016-11-01 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
c->next = XCNEW (gfc_code);
*c->next = new_st;
+ c->next->loc = gfc_current_locus;
gfc_clear_new_st ();
new_st.op = EXEC_WHERE;
c = gfc_get_code (EXEC_WHERE);
c->expr1 = expr;
+ /* Put in the assignment. It will not be processed by add_statement, so we
+ need to copy the location here. */
+
c->next = XCNEW (gfc_code);
*c->next = new_st;
+ c->next->loc = gfc_current_locus;
gfc_clear_new_st ();
new_st.op = EXEC_WHERE;
+2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/69544
+ PR fortran/78178
+ * gfortran.dg/where_5.f90: New test.
+ * gfortran.dg/where_6.f90: New test.
+
2016-11-05 Martin Sebor <msebor@redhat.com>
Backport from trunk.
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Wcharacter-truncation" }
+subroutine where_ice (i,j)
+
+ implicit none
+
+ character(8) :: y(10,10,2)
+
+ integer :: i
+ integer :: j
+
+ character(12) :: txt(5)
+ where (txt(1:3) /= '' ) y(1:3,i,j) = txt(1:3) ! { dg-warning "CHARACTER expression will be truncated" }
+
+end subroutine where_ice
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Wcharacter-truncation" }
+subroutine where_ice (i,j)
+
+ implicit none
+
+ character(8) :: y(10,10,2)
+
+ integer :: i
+ integer :: j
+
+ character(12) :: txt(5)
+ if (.true.) where (txt(1:3) /= '' ) y(1:3,i,j) = txt(1:3) ! { dg-warning "CHARACTER expression will be truncated" }
+
+end subroutine where_ice