[Top][All Lists]

[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: Sat, 30 Dec 2006 08:08:46 EST

> Not so appalling really, given that relying on wrapping is as has
> been pointed out in this thread, the most natural and convenient way
> of testing for overflow. It is really *quite* difficult to test for
> overflow while avoiding overflow, and this is something that is
> probably not in the lexicon of many C programmers.

I guess that's true even in GCC.  I looked at the OVERFLOW_SUM_SIGN macro in
fold-const.c.  But on the positive side, the test is isolated in one place
and so is easy to fix.

Moreover, as was said earlier in this thread, although it's hard to formally
define the subset, it's hard to see how any of the optimizations proposed
that take advantage of undefined overflow would, in pratice, actually break
this idiom.

reply via email to

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