bug-gnulib
[Top][All Lists]
Advanced

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

Re: GCC optimizes integer overflow: bug or feature?


From: Robert Dewar
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: Tue, 19 Dec 2006 06:15:19 -0500
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Gabriel Dos Reis wrote:
Andrew Haley <address@hidden> 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.

The other danger in using nonstandard in this peculiar way is that
it is too easy to use or at least think in terms of the argument.

This feature is nonstandard
We want gcc to be standard
Therefore we don't want this feature

which is faulty reasoning in this particular case. The ONLY reason
for doing the optimization is to improve performance, it does not
somehow make gcc more standard to take implement undefined in an
unpredictable manner :-)




reply via email to

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