RE: gcc 3.3 / i386 / -O2 question

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

 



Hi,

On Wed, 17 Nov 2004, Dave Korn wrote:

>   Excuse me for butting in, but I don't understand what makes anyone
> think this code _ought_ to produce the same results at different -O
> levels[*].

While it's true that with signed arithmetic we are allowed to simply
break, such behaviour can (and in this case indeed does) point out a real
problem in the optimizers, so its often a bit too hasty to ignore a
problem just because the source code is not totally conformant.  With
unsigned int a similar thing happens, namely that the second call to
H(B,C) is deleted.  The SuSE compiler has unit-at-a-time, hence determines
that H is in fact a const function.  Somehow it misses that C is modified
between the two calls, ergo it thinks that both calls give the same 
results, and deletes the latter.


Ciao,
Michael.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux