This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Document arithmetic overflow semantics
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: roger at www dot eyesopen dot com, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: 13 Feb 2003 15:43:32 +0100
- Subject: Re: [PATCH] Document arithmetic overflow semantics
- Organization: Integrable Solutions
- References: <10302131439.AA01809@vlsi1.ultra.nyu.edu>
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