This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Fix tree-opt/29788, plain CONST_DECL leaking through
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Tue, 14 Nov 2006 10:36:34 -0800
- Subject: Re: [PATCH] Fix tree-opt/29788, plain CONST_DECL leaking through
- 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=Gn1sD6kwlKUOJJE8gLG3n2Cv+FDyrtaoVGPSRod2EexyzkTo30j8+fnoeOCfBPi1ieh52RA2gxvkSWRq0Q5eV1z9lYis8Rxrb5QXgDSCwckrKYBFSENnrO1zJQ6cutiuzttvHJZ3wxFVzGTVltJLz4rWZ+/0KC5yGu3cnFPi3Yc=
- References: <1163431038.2539.61.camel@celery.andrew.com> <m37ixx28wm.fsf@localhost.localdomain>
On Tue, 2006-11-14 at 10:14 -0800, Ian Lance Taylor wrote:
> Andrew Pinski <pinskia@gmail.com> writes:
>
> > * tree-inline.c (copy_body_r): Call fold after folding indirect
> > reference.
> >
> > * gfortran.fortran-torture/compile/inline_1.f90: New test.
>
> > + *tp = fold (*tp);
>
> I don't understand why this call to fold is needed if
> fold_indirect_ref_1 returned a non-NULL value. In that case, it seems
> to me that we will have already folded the value.
The reason issue is fold_indirect_ref_1 does not fold a CONST_DECL after
folding *&CONST_DECL. I have a better fix which was recommended by
Roger.
Thanks,
Andrew Pinski