diff mbox

[fortran,committed] Fix PR 71795

Message ID 50eecddc-0c6b-7433-c282-991a0b32ee9b@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig July 22, 2016, 10:40 a.m. UTC
Hello world,

I have committed the attached patch as obvious and simple
after regression-testing. This fixes a regression.

Will commit to the other affected branches shortly.

Regards

	Thomas

2016-07-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/71795
         * frontend-passes.c (combine_array_constructor):  Don't
         do anything if the expression is inside an array iterator.

2016-07-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/71795
         * gfortran.dg/constructor_50.f90:  New test.
diff mbox

Patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(Revision 238497)
+++ frontend-passes.c	(Arbeitskopie)
@@ -1255,6 +1255,11 @@  combine_array_constructor (gfc_expr *e)
   if (forall_level > 0)
     return false;
 
+  /* Inside an iterator, things can get hairy; we are likely to create
+     an invalid temporary variable.  */
+  if (iterator_level > 0)
+    return false;
+
   op1 = e->value.op.op1;
   op2 = e->value.op.op2;