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:48:36 EST
- Subject: Re: [PATCH] Document arithmetic overflow semantics
> Are you really claiming that a program with an uninitialized variable
> must be compiled in such a way that it produces the same result
> independent of optimization?
You got me. Naturally there are limits. GCC can't claim that two runs
of the same executable with an uninitialized variable produce the same
result.
So then to rephrase the question I asked in my last question, what are those
limits, where do we document them, and how do we decide what they are?
I'm more familiar with the Ada standard than that for C99 and C++ and
there are dozens of places where they describe things that are undefined.
Are you proposing that we look at each of those, choose (by what criteria?)
whether we guarantee that a program that has that particular undefined
behavior is preserved over optimization, and document our choice somewhere?
And that we do the same for C, C++, Fortran and Java?
If not, precisely *what* are you proposing: I don't understand.