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

2007-01-01 Thread Joe Buck
Mark Mitchell <[EMAIL PROTECTED]> writes: > > let's disable the assumption about signed overflow not wrapping for > > VRP, but leave it in place for loop analysis. On Mon, Jan 01, 2007 at 06:09:41PM -0800, Paul Eggert wrote: > As far as I know this will work for all the wrapv-assuming code that >

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

2007-01-01 Thread Joe Buck
On Mon, Jan 01, 2007 at 07:33:06AM -0500, Richard Kenner wrote: > > the seemingly prevalent attitude "but it is undefined; but it is not > > C" is the opinion of the majority of middle-end maintainers. > > Does anybody DISAGREE with that "attitude"? It isn't valid C to assume that > signed overfl

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

2007-01-01 Thread Joe Buck
On Mon, Jan 01, 2007 at 10:24:36AM -0800, Andrew Pinski wrote: > Then the question is why does C developers act differently than Fortran > developers when it comes to undefinedness? In the case of int overflow wrapping, I think it's because the Bell Labs folks appeared to assume wrapping semantics

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

2006-12-30 Thread Joe Buck
On Sat, Dec 30, 2006 at 08:57:12PM -0500, Richard Kenner wrote: > > I suppose there is > > > > *hv = (HOST_WIDE_INT) -(unsigned HOST_WIDE_INT) h1; > > > > to make it safe. > > Can't that conversion overflow? Not on a two's complement machine, and I know of no gcc ports to a non-two's-comp

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

2006-12-30 Thread Joe Buck
On Sat, Dec 30, 2006 at 09:52:24PM -0800, Paul Eggert wrote: > Wait, though: K&Rv2 is post-C89. If memory serves, it was C89 > that established the rule that signed integer overflow has > undefined behavior whereas unsigned overflow is well-defined. I don't have the original K&R book so can't tel

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

2006-12-30 Thread Joe Buck
On Fri, Dec 29, 2006 at 10:44:02PM +0100, Florian Weimer wrote: > Does autoconf enable higher optimization levels for other compilers by > default? Yes. Rather, some other compilers default to optimization on, unless the user explicitly turns it off with -O0. (Example: icc).

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

2006-12-30 Thread Joe Buck
On Sat, Dec 30, 2006 at 04:13:08PM -0800, Paul Eggert wrote: > I am. I just now looked and found another example. > gcc-4.3-20061223/gcc/fold-const.c's neg_double function > contains this line: > > *hv = - h1; > > This one is a bit less obvious because it doesn't have a > "Danger Will Robi

Re: GCC optimizes integer overflow: bug or feature?

2006-12-19 Thread Joe Buck
On Tue, Dec 19, 2006 at 10:25:41PM +0100, Denis Vlasenko wrote: > ... It's not about standards. It's about sanity. So what happens when two different people's concept of "sanity" differs? That's why we have standards, so both can consult a reference and wind up with the same concept, even though o

Re: GCC optimizes integer overflow: bug or feature?

2006-12-19 Thread Joe Buck
On Tue, Dec 19, 2006 at 12:05:44PM -0800, Ian Lance Taylor wrote: > Here is a quick list of optimizations that mainline gcc performs which > rely on the idea that signed overflow is undefined. All the types > are, of course, signed. I made have made some mistakes. I think this > gives a good fee