[PATCH] Document arithmetic overflow semantics

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Feb 13 14:58:00 GMT 2003


kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

|     The fact that the behaviour of overflow is undefined in C, C++ and Ada
|     does not mean that "overflow cannot occur".  Quite clearly overflows do
|     occur, and the optimizers are paralyzed by the semantics in this event.
| 
| I think that's backwards.  If program in C, C++, or Ada generates an
| overflow, that program is undefined.  That means the optimizer can do
| anything it wants to the program,

including honoring stringent standards like LIA.  
We ought to be careful about what we do to programs, given C99 requirements
(and C++)'s.

-- Gaby



More information about the Gcc mailing list