aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRask Ingemann Lambertsen <rask@sygehus.dk>2007-09-09 21:21:59 +0200
committerRask Ingemann Lambertsen <rask@gcc.gnu.org>2007-09-09 19:21:59 +0000
commit921c44189aae73ef85ea7ac4712e54f667fdd4f6 (patch)
tree9cf93feb394109316dfdca4d1a5926ddbe2320f6 /gcc/simplify-rtx.c
parent0098d8068657d4d1aa61585993a0a3e5ef6be2c8 (diff)
downloadgcc-921c44189aae73ef85ea7ac4712e54f667fdd4f6.zip
gcc-921c44189aae73ef85ea7ac4712e54f667fdd4f6.tar.gz
gcc-921c44189aae73ef85ea7ac4712e54f667fdd4f6.tar.bz2
re PR target/30315 (optimize unsigned-add overflow test on x86 to use cpu flags from addl)
PR target/30315 * config/i386/i386.h (CANONICALIZE_COMPARISON): Delete. * simplify-rtx.c (simplify_relational_operation_1): Add the canonicalization from i386.h. * doc/md.texi (Canonicalization of Instructions): Document it. From-SVN: r128305
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ac91f2f..02f9e2b 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3813,6 +3813,12 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
}
}
+ /* Canonicalize (LTU/GEU (PLUS a b) b) as (LTU/GEU (PLUS a b) a). */
+ if ((code == LTU || code == GEU)
+ && GET_CODE (op0) == PLUS
+ && rtx_equal_p (op1, XEXP (op0, 1)))
+ return simplify_gen_relational (code, mode, cmp_mode, op0, XEXP (op0, 0));
+
if (op1 == const0_rtx)
{
/* Canonicalize (GTU x 0) as (NE x 0). */