This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: ICE in write() with gfortran 4.1.2
- From: Andrew Pinski <pinskia at gmail dot com>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: Thomas Koenig <Thomas dot Koenig at online dot de>, Charlie Zender <zender at uci dot edu>, fortran at gcc dot gnu dot org
- Date: Sat, 25 Nov 2006 13:47:04 -0800
- Subject: Re: ICE in write() with gfortran 4.1.2
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=qO+HWtNKzjZruLiSsFdPDuwNg1FkP9E/it1UV9z09ADymHRDU9n4v5ncWM6kC9TnwPXLA38p45UqGh+PWbgp7sDgE9hN+iZbRd+H5VCOagjSAIs3U29C2ooNSVW9k5SMQm5MZmbSofnAncierixHl5K/mcfY8P+9VnO9A031yz4=
- References: <4568A4D3.6010806@uci.edu> <20061125202942.GA6266@meiner.onlinehome.de> <1164490667.19849.134.camel@celery.andrew.com> <B318204F-FA2A-47D3-B04A-C1EB2726EC48@gmail.com>
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