[PATCH] Constant fold -A - B as -B - A (take 2)

Fergus Henderson fjh@cs.mu.OZ.AU
Mon Feb 10 16:27:00 GMT 2003


On 10-Feb-2003, Richard Kenner <kenner@vlsi1.ultra.nyu.edu> wrote:
>     > There is *no* language, as far as I know, for which MAX_INT + 1 is
>     > defined, let alone equal to MIN_INT.
> 
>     What about Java, C#, and Visual Basic?
> 
> I stand corrected.
> 
> This indicates that we really ought to add a bit to types to indicate
> whether or not overflow is defined.  Right now that's the unsigned
> bit, but, from what you say, that's clearly wrong.

IMHO it would be more natural to add the bit to operations
(e.g. to PLUS_EXPR tree nodes) rather than to types.

Actually there are more than two possibilities:
	1. overflow wraps
	2. overflow leads to undefined behaviour
	3. overflow is detected, and leads to a
	   trap/exception/signal/whatever.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.



More information about the Gcc-patches mailing list