This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC optimizes integer overflow: bug or feature?
Gabriel Dos Reis writes:
> Andrew Haley <aph@redhat.com> writes:
>
> | Robert Dewar writes:
> | > Andrew Haley wrote:
> | >
> | > > We've already defined `-fwrapv' for people who need nonstandard
> | > > arithmetic.
> | >
> | > Nonstandard implies that the result does not conform with the standard,
> |
> | I don't think it does; it merely implies that any program which
> | requires "-fwrapv" for correct execution is not a strictly conforming
> | program.
>
> How many useful C programs do you know that are strictly conforming?
> Certainly, GCC isn't stritcly conforming.
>
> I suspect the actual argument must be somewhere else.
I'm sure it is. The only purpose of my mail was to clarify what I
meant by "nonstandard", which in this case was "not strictly
conforming". I didn't intend to imply anything else.
In this case, there are two ways to view the program: either it has a
bug, or it has an environmental depencency on wrapping integer
arithmetic.
Andrew.