This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Document arithmetic overflow semantics
- From: Roger Sayle <roger at www dot eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Feb 2003 10:41:35 -0700 (MST)
- Subject: Re: [PATCH] Document arithmetic overflow semantics
On Thu, 13 Feb 2003, Richard Henderson wrote:
> On Thu, Feb 13, 2003 at 08:31:33AM -0700, Roger Sayle wrote:
> > At the GCC internal level there should be no such thing as undefined
> > behaviour, this is a front-end concept.
>
> I disagree. It's the undefinedness we want to take advantage of.
How? Any new optimization that we introduce that takes advantage
of the undefinedness will both produce different results from the
current versions of GCC, and will break the Java front-end.
New SSA-level loop optimizations will have great difficulty being as
effective as loop.c's loop_iterations that can determine how many times
to a loop iterates at the RTL-level even in the presence of overflows.
Its a simple evolutionary step for GCC, whether the internal tree-level
representation reflects the C/C++ semantics reflecting its heritage,
or is truly an intermediate representation for the "GNU Compiler
Collection" that is consistent with C/C++. For SSA, tree's need to
be a language independent high-level abstraction of the RTL.
Do you believe the Java front-end is currently incorrect to use
PLUS_EXPR to represent signed addition?
Roger
--