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


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