ICE in write() with gfortran 4.1.2
Andrew Pinski
pinskia@gmail.com
Sun Nov 26 04:28:00 GMT 2006
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
More information about the Fortran
mailing list