diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2003-07-13 19:03:28 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2003-07-13 19:03:28 +0000 |
commit | 34ed3bb00e99bb22e24b3dab90f5923cad8483a5 (patch) | |
tree | 51a09073a2178bbf964307889e2cf35c5a8241c7 /gcc/combine.c | |
parent | 1a7d0840430a6af4d15bfe67bfa43dd93b4e08a9 (diff) | |
download | gcc-34ed3bb00e99bb22e24b3dab90f5923cad8483a5.zip gcc-34ed3bb00e99bb22e24b3dab90f5923cad8483a5.tar.gz gcc-34ed3bb00e99bb22e24b3dab90f5923cad8483a5.tar.bz2 |
combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0) to (eq (and X 1) 0).
* combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0)
to (eq (and X 1) 0).
From-SVN: r69300
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 499e7b9..3c3172b 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11059,6 +11059,17 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) } } + /* Convert (ne (and (not X) 1) 0) to (eq (and X 1) 0). */ + if (const_op == 0 && equality_comparison_p + && XEXP (op0, 1) == const1_rtx + && GET_CODE (XEXP (op0, 0)) == NOT) + { + op0 = simplify_and_const_int + (op0, mode, XEXP (XEXP (op0, 0), 0), (HOST_WIDE_INT) 1); + code = (code == NE ? EQ : NE); + continue; + } + /* Convert (ne (and (lshiftrt (not X)) 1) 0) to (eq (and (lshiftrt X) 1) 0). */ if (const_op == 0 && equality_comparison_p |