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: jbuck at synopsys dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 13 Feb 03 12:38:30 EST
- Subject: Re: [PATCH] Document arithmetic overflow semantics
I doubt it; the reason is that the particular assumption that addition
and multiplication follow the natural two's complement rules gives us
an algebraic ring, which makes many transformations possible. Any other
assumption would introduce an irregularity that has to be tested for in
each transformation.
I'm thinking of (A * 2) / 2. This is A only if you are allowed to
assume that an overflow of the multiplication is undefined.
There are numerous cases in loop optimizations too.