List of optimizations enabled by -O1 seems incorrect

Bill McEnaney bill@rkirkpat.net
Fri Aug 14 18:51:00 GMT 2009


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



More information about the Gcc-help mailing list