aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-06-30 09:02:00 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-06-30 09:02:00 +0000
commita4398a300ed00d842f9786d529a7a4b0fce6e634 (patch)
tree58346bd90053e6a614e0e37ed3fed21fc9b01ece /gcc/fold-const.c
parent582554e3bc1509b6ddc407004f97e3f756bcedf5 (diff)
downloadgcc-a4398a300ed00d842f9786d529a7a4b0fce6e634.zip
gcc-a4398a300ed00d842f9786d529a7a4b0fce6e634.tar.gz
gcc-a4398a300ed00d842f9786d529a7a4b0fce6e634.tar.bz2
fold-const.c (fold_binary_loc): Move ~X | X folding ...
* fold-const.c (fold_binary_loc): Move ~X | X folding ... * match.pd: ... here. * gcc.dg/fold-ior-2.c: New test. From-SVN: r225164
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 5cdb6d1..f330d78 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10922,24 +10922,6 @@ fold_binary_loc (location_t loc,
case BIT_IOR_EXPR:
bit_ior:
- /* ~X | X is -1. */
- if (TREE_CODE (arg0) == BIT_NOT_EXPR
- && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0))
- {
- t1 = build_zero_cst (type);
- t1 = fold_unary_loc (loc, BIT_NOT_EXPR, type, t1);
- return omit_one_operand_loc (loc, type, t1, arg1);
- }
-
- /* X | ~X is -1. */
- if (TREE_CODE (arg1) == BIT_NOT_EXPR
- && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0))
- {
- t1 = build_zero_cst (type);
- t1 = fold_unary_loc (loc, BIT_NOT_EXPR, type, t1);
- return omit_one_operand_loc (loc, type, t1, arg0);
- }
-
/* Canonicalize (X & C1) | C2. */
if (TREE_CODE (arg0) == BIT_AND_EXPR
&& TREE_CODE (arg1) == INTEGER_CST