This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Constant fold -A - B as -B - A (take 2)
- From: Andreas Schwab <schwab at suse dot de>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: roger at www dot eyesopen dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Feb 2003 14:54:11 +0100
- Subject: Re: [PATCH] Constant fold -A - B as -B - A (take 2)
- References: <10302080306.AA04065@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
|> Is your use of the word "legal" based upon C/C++ standards? My
|> understanding was that the semantics of expressions at the tree
|> level were supposed to be independent of the front-ends, and that
|> if an operation is undefined in some subset of front-ends then
|> choosing a behaviour that's consistent across the others is a
|> reasonable prerogative.
|>
|> There is *no* language, as far as I know, for which MAX_INT + 1 is defined,
|> let alone equal to MIN_INT. So GCC is entitled to assume that EXP + 1 > EXP,
|> for example.
Except if you are dealing with unsigned arithmetic, which has defined
wrap-around semantics.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."