This is the mail archive of the gcc@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]

Re: lazy execution optimization


  In message <19990927111528.D11850@zosma.inria.fr>you write:
  > On Sun, Sep 26, 1999 at 06:14:49PM -0400, Steven W. Orr wrote:
  > > I'm definitely not a qualified person to answer this, but have you tried
  > > the following construct to see if the outcome is affected:
  > > 
  > > int f (double a, double b)
  > > {
  > >   double c;
  > >   c = a+b;
  > >   if (a > 0.0)
  > >     return 0;
  > >   else if (c > 0.0)
  > >     return 1;
  > >   else
  > >     return 2;
  > > }
  > 
  > It doesn't change anything.
  > Let me be more clear.  More generally, if I have a block:
  > 
  >   {
  >     computing some data (A) needed for "test" or for both branches.
  >     computing some data (B) not needed for the test, nor the exit branch.
  > 
  >     if (test) { exit the block; }
  >     use B;
  >   }
This is known as partial dead code elimination.  It is not an optimization
GCC currently performs; however, much of the underlying framework exists to
perform this optimization (lcm.c).

jeff


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