diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2015-05-26 13:14:16 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2015-05-26 11:14:16 +0000 |
commit | 534bd33b61d08e0bf4d58efbeb3da5a368f8a247 (patch) | |
tree | d7b381032a45d7b3441c2f5139e9c9af5a65d583 /gcc/fold-const.c | |
parent | c3dc5e6654a2911c955eb9371ed7d6e5c2d1a174 (diff) | |
download | gcc-534bd33b61d08e0bf4d58efbeb3da5a368f8a247.zip gcc-534bd33b61d08e0bf4d58efbeb3da5a368f8a247.tar.gz gcc-534bd33b61d08e0bf4d58efbeb3da5a368f8a247.tar.bz2 |
match.pd (swapped_tcc_comparison): New operator list.
2015-05-26 Marc Glisse <marc.glisse@inria.fr>
* match.pd (swapped_tcc_comparison): New operator list.
(-A CMP -B): New simplification.
* fold-const.c (fold_comparison): Remove corresponding code.
From-SVN: r223689
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c38a633..5545ecf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -9183,24 +9183,11 @@ fold_comparison (location_t loc, enum tree_code code, tree type, fold_convert_loc (loc, newtype, targ0), fold_convert_loc (loc, newtype, targ1)); - /* (-a) CMP (-b) -> b CMP a */ - if (TREE_CODE (arg0) == NEGATE_EXPR - && TREE_CODE (arg1) == NEGATE_EXPR) - return fold_build2_loc (loc, code, type, TREE_OPERAND (arg1, 0), - TREE_OPERAND (arg0, 0)); - if (TREE_CODE (arg1) == REAL_CST) { REAL_VALUE_TYPE cst; cst = TREE_REAL_CST (arg1); - /* (-a) CMP CST -> a swap(CMP) (-CST) */ - if (TREE_CODE (arg0) == NEGATE_EXPR) - return fold_build2_loc (loc, swap_tree_comparison (code), type, - TREE_OPERAND (arg0, 0), - build_real (TREE_TYPE (arg1), - real_value_negate (&cst))); - /* IEEE doesn't distinguish +0 and -0 in comparisons. */ /* a CMP (-0) -> a CMP 0 */ if (REAL_VALUE_MINUS_ZERO (cst)) |