This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29565] [4.1/4.2/4.3 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c



------- Comment #5 from pault at gcc dot gnu dot org  2006-10-25 07:18 -------
This fixes it but has not been regtested.  I was hoping  to have found a
slightly cleaner way to fix this but did not alight on anything that would not
be a big performance.  It's OK for rank 1 arrays but for rank 2 or higher,
carries baggage in the form of various other declarations from the loopinfo
that was never used.

Index: gcc/fortran/trans-expr.c
===================================================================
*** gcc/fortran/trans-expr.c    (revision 117860)
--- gcc/fortran/trans-expr.c    (working copy)
*************** gfc_conv_aliased_arg (gfc_se * parmse, g
*** 1708,1716 ****
      }
    else
      {
!       /* Make sure that the temporary declaration survives.  */
!       tmp = gfc_finish_block (&body);
!       gfc_add_expr_to_block (&loop.pre, tmp);
      }

    /* Add the post block after the second loop, so that any
--- 1708,1721 ----
      }
    else
      {
!       /* Make sure that the temporary declaration survives by merging
!        all the loop declarations into the current context.  */
!       for (n = 0; n < loop.dimen; n++)
!       {
!           gfc_merge_block_scope (&body);
!         body = loop.code[loop.order[n]];
!       }
!       gfc_merge_block_scope (&body);
      }

    /* Add the post block after the second loop, so that any 

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29565


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]