This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
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 overflow wraps. I've heard nobody argue that it is. The question
> is how far we go in supporting existing code that's broken in this way.
The problem is that often-unconscious assumptions that int overflow wraps
are very widespread. If the compiler won't build GNU/Linux distros, then
we have a serious problem no matter what the standard says.
For one thing, we are hypocrites if we tell people that the fact that
gcc broke their code that assumes -fwrapv is not our problem, while gcc
itself assumes -fwrapv in several places!
We could say that the uses in fold-const are ok while others aren't, but
that would require coming up with a rule that distinguishes the cases.