This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR40011 - Problems with -fwhole-file
- From: Richard Guenther <rguenther at suse dot de>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, fortran at gcc dot gnu dot org
- Date: Fri, 24 Jul 2009 11:04:44 +0200 (CEST)
- Subject: Re: [Patch, fortran] PR40011 - Problems with -fwhole-file
- References: <339c37f20907231505t2d33dad0oc9f886eb0b22cb27@mail.gmail.com> <4A68EF20.9080507@net-b.de>
On Fri, 24 Jul 2009, Tobias Burnus wrote:
> Paul Richard Thomas wrote:
> > This patch bootstraps and regtests without -fwhole-file. When
> > regtested with -fwhole-file it fails on legacy features or wrong code
> > in the tests. I will eliminate the latter as the next step. I have
> > yet to go through it with a fine toothed comb to be sure that clean up
> > is OK nor have I prepared the ChangeLogs.
> >
> I think it would be interesting to see how it performs with SPEC and
> with -lto. -- And whether we can break -fwhole-file with any other code ;-)
>
> > The following fails at any level of optimization [...]
> >
> As written, I think the behaviour is OK as the local variable is no
> longer available after returning from the procedure. However, it would
> be interesting to know why it fails. Richard, do you understand why the
> condition is no longer optimized away?
I'll have a look.
> > +
> > + /* Code with static variables must not be inlined. */
> > + if (TREE_STATIC (decl) && DECL_CONTEXT (decl))
> > + DECL_UNINLINABLE(DECL_CONTEXT (decl)) = 1;
> > }
> >
> My understanding is that inlining should work in principle. I think one
> can leave it for the beginning, but one should think about this spot.
> (Potential missed optimization.) Richard, do you see a reason why one
> needs to set this?
No. In fact this check looks bogus to me - it may of course hide
bugs, but that's not a good idea at this stage I think.
Richard.