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: Wed, 20 Dec 2006 06:56:07 -0500
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Zdenek Dvorak wrote:

actually, you do not even need (invalid) multithreaded programs to
realize that register allocation may change behavior of a program.
If the size of the stack is bounded, register allocation may
cause or prevent program from running out of stack, thus turning a
crashing program to non-crashing one or vice versa.

Again, I think it is useful to distinguish functional behavior changes
from changes that come from resource utilization. Yes, optimization
will always change resource utilization. That's the whole point, so
if you include resource utilization as a change in behavior, then
you lose the useful distinction between optimizations like

  a*2 => a+a

which could change the size of an executable

but which of itself is functionally neutral

from optimizations which are not functionally neutral for
programs with undefined or implementation defined semantics
(e.g. fast math).

Note that another possible effect of *any* optimization, is to
change the address of data and code throughout the program, and
of course this could wake up some implementation or buggy
behavior that depended on specific addresses of data or code.
Again, it is useful to exclude these indirect effects.




reply via email to

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