This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: ICE in write() with gfortran 4.1.2


On Sat, 2006-11-25 at 22:40 +0100, FX Coudert wrote:
> > This is my fault, I changed the middle-end to produce an extra  
> > NOP_EXPR
> > and we produced a CONST_DECL in the front-end with the NOP_EXPR which
> > caused this bug.
> >
> > I have a fix which I am going to bootstrap and test.
> 
> I'm not sure you're the culprit here, it's broken on 4.1.2, 4.2 and  
> 4.3 on all targets I could test.

FYI, here is a preview of the fix:
Index: trans-expr.c
===================================================================
--- trans-expr.c        (revision 119211)
+++ trans-expr.c        (working copy)
@@ -3133,8 +3133,10 @@ gfc_conv_expr_reference (gfc_se * se, gf
   /* Create a temporary var to hold the value.  */
   if (TREE_CONSTANT (se->expr))
     {
-      var = build_decl (CONST_DECL, NULL, TREE_TYPE (se->expr));
-      DECL_INITIAL (var) = se->expr;
+      tree tmp = se->expr;
+      STRIP_TYPE_NOPS (tmp);
+      var = build_decl (CONST_DECL, NULL, TREE_TYPE (tmp));
+      DECL_INITIAL (var) = tmp;
       TREE_STATIC (var) = 1;
       pushdecl (var);
     }


-- Pinski


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