This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Document arithmetic overflow semantics
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: roger at www dot eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 13 Feb 03 10:35:41 EST
- Subject: Re: [PATCH] Document arithmetic overflow semantics
I completely disagree, and so do GCC's patch reviewers. The behaviour
of a program with optimization should always be the same as its behaviour
without optimization.
Another example of where that's false:
We've said many times that a program that contains an expression of
the form
i = i++;
need not produce the same results in different optimization levels.
You seem to be trying to divide the set of things that make a program
undefined into two sets: those that we must preserve over optimization
and those that we need not. What criteria do you propose to use to choose,
for each example of undefined behavior, which of those cases we apply?