[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer
From: |
Richard B. Kreckel |
Subject: |
Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4) |
Date: |
Wed, 20 Dec 2006 00:10:59 +0100 (CET) |
On Mon, 18 Dec 2006, Andrew Pinski wrote:
> On Tue, address@hidden:54 +0100, Ralf Wildenhues wrote:
> > > Wheeeoo! That optimization is going to break a _lot_ of GNU
> > > software. (Silently. Oh my.)
>
> Just like say strict aliasing? :)
I find an analogy with -ffast-math much less far-fetched than one with
-fstrict-aliasing. Quoting from the GCC documentation:
This option [-ffast-math] should never be turned on by any `-O'
option since it can result in incorrect output for programs which
depend on an exact implementation of IEEE or ISO rules/specifications
for math functions.
C89 did not refer to IEEE 754 / IEC 60559. Yet, as far as I am aware,
-ffast-math or the implied optimizations have never been turned on by GCC
unless explicitly requested. That was a wise decision.
By the same token it would be wise to refrain from turning on any
optimization that breaks programs which depend on wrapping signed
integers. Silently breaking LIA-1 semantics is imprudent.
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
- Re: GCC optimizes integer overflow: bug or feature?, (continued)
- Re: GCC optimizes integer overflow: bug or feature?, Dorit Nuzman, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Andrew Haley, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Gabriel Dos Reis, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Andrew Haley, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Gabriel Dos Reis, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Zdenek Dvorak, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4),
Richard B. Kreckel <=
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4), Marcin Dalecki, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Richard B. Kreckel, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Marcin Dalecki, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Richard B. Kreckel, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Marcin Dalecki, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Richard B. Kreckel, 2006/12/21
Re: avoid integer overflow in mktime.m4, Paul Eggert, 2006/12/22
Re: avoid integer overflow in mktime.m4, Paul Eggert, 2006/12/22