autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."


From: Richard Kenner
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Sun, 31 Dec 2006 14:45:30 EST

> I think this is a fragile and not very practical approach.  How do
> you define these "traditional" cases?  

You don't need to define the "cases" in advance.  Rather, you look at
each place where you'd be making an optimization based on the non-existance
of overflow and use knowlege of the importance of that optimization and the
types of code likely to trigger it to choose the default for whether to make
it or not.  It seems quite practical to me.

It also doesn't seem fragile: if you guess wrong on one particular default,
it's easy to change it.

> I guess you would keep the other two as well, so have the mid ground
> default, -fno-wrapv do what we have now and -fwrapv disable all the
> optimizations.

Right.  That's certainly my proposal.

> I'd rather enable -fwrapv at -O1 and keep -O2 as is.  This is what
> we also do for strict-aliasing, it's enabled at -O2 and beyond only
> (for C, that is).  Of course with -O1 the VRP pass is not run, so it
> might be that the reported problems do not show up with -O1 - and as
> they are reportedly not for performance critical code they should
> maybe just use -O1 as autoconf default.

My concern here would be the loop stuff.  That's such an important optimization
and has so low chance of causing problems that I think non-wrapping should
be assumed for it at each level that it applies.  I agree that it might
be reasonable to change some of the defaults so they change as a function
of the optimization level.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]