This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: List of optimizations enabled by -O1 seems incorrect
- From: "Bill McEnaney" <bill at rkirkpat dot net>
- To: "Kevin P. Fleming" <kpfleming at digium dot com>, Andrew Haley <aph at redhat dot com>, Ian Lance Taylor <iant at google dot com>, gcc-help at gcc dot gnu dot org
- Date: Fri, 14 Aug 2009 10:58:12 -0600 (MDT)
- Subject: Re: List of optimizations enabled by -O1 seems incorrect
What would it turn this into, Andrew?
if (!(foo || bar))
> Andrew Haley wrote:
>
> > gcc looks at
> >
> > if (!foo && !bar)
> > ...
> >
> > and turns it into
> >
> > if (foo|bar)
> > goto x;
> > ...
> > x:
> >
> > So, from Valgrind's point of view, the branch depends on the value of
> > bar, which is uninitialized. We know that if foo is nonzero there is
> > no such dependency, but Valgrind would have to do some heavyweight
> > dependency analysis to figure that one out.
>
> Ding-ding-ding... and the winner is, I'm not awake enough yet this
> morning :-) Thanks for the explanation!
>
> --
> Kevin P. Fleming
> Digium, Inc. | Director of Software Technologies
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> skype: kpfleming | jabber: kpfleming@digium.com
> Check us out at www.digium.com & www.asterisk.org
>
>
________________________________________________________________
Please visit a saintly hero:
http://www.jakemoore.org