This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: lazy execution optimization
- To: Sylvain Pion <Sylvain dot Pion at sophia dot inria dot fr>
- Subject: Re: lazy execution optimization
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 27 Sep 1999 11:10:23 -0600
- cc: "Steven W. Orr" <steveo at world dot std dot com>, gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
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