This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Constant fold -A - B as -B - A (take 2)
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Feb 2003 03:25:40 +1100
- Subject: Re: [PATCH] Constant fold -A - B as -B - A (take 2)
- References: <10302101600.AA12300@vlsi1.ultra.nyu.edu>
On 10-Feb-2003, Richard Kenner <firstname.lastname@example.org> 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
Fergus Henderson <email@example.com> | "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.