This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, fortran] PR40011 - Problems with -fwhole-file


On Fri, 24 Jul 2009, Richard Guenther wrote:

> 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.

I see no change in the generated code with -O3 -fwhole-file before
or after the patch.  I don't see how we could optimize the conditions
as we have

  base.this = &j;
  D.1550_9 = j.this;
  D.1549_10 = D.1550_9 != &base;
  D.1548_13 = D.1550_9 == 0B;
  D.1547_14 = D.1548_13 | D.1549_10;
  if (D.1547_14 != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  _gfortran_abort ();

where j is uninitialized (the stores to it have been optimized away
before inlining).  Whether j.this != &base we cannot tell.

Richard.


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