diff mbox

[fortran] Fix PR 69544

Message ID a65f8fcb-fc4a-dd0c-da55-ce9670330493@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig Nov. 1, 2016, 10:58 a.m. UTC
Hello world,

the attached, rather simple, patch, fixes a regression where
the locus was not set, leading to an ICE on a warning.

Regression-tested on trunk. OK on all affected and open branches
(7/6/5)?

Regards

	Thomas

2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/69544
         * match.c (gfc_match_where):  Fill in locus for assigment
         in simple WHERE statement.

2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/69544
         * gfortran.dg/where_5.f90:  New test.

Comments

Steve Kargl Nov. 1, 2016, 2:03 p.m. UTC | #1
On Tue, Nov 01, 2016 at 11:58:10AM +0100, Thomas Koenig wrote:
> 
> the attached, rather simple, patch, fixes a regression where
> the locus was not set, leading to an ICE on a warning.
> 
> Regression-tested on trunk. OK on all affected and open branches
> (7/6/5)?
> 

Yes.
diff mbox

Patch

Index: match.c
===================================================================
--- match.c	(Revision 241590)
+++ match.c	(Arbeitskopie)
@@ -6265,8 +6265,12 @@  gfc_match_where (gfc_statement *st)
   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;