diff options
author | Marek Polacek <polacek@redhat.com> | 2015-07-17 16:03:27 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-07-17 16:03:27 +0000 |
commit | f7b7b0aab82d50165f9d3fb375cd506af999a288 (patch) | |
tree | d4aac49e43d9016064da83586d41d363856c3f67 /gcc/fold-const.c | |
parent | afb2d80bc57bddd52bb04869861bf40503a3e89d (diff) | |
download | gcc-f7b7b0aab82d50165f9d3fb375cd506af999a288.zip gcc-f7b7b0aab82d50165f9d3fb375cd506af999a288.tar.gz gcc-f7b7b0aab82d50165f9d3fb375cd506af999a288.tar.bz2 |
fold-const.c (fold_binary_loc): Move A - (A & B) into ~B & A ...
* fold-const.c (fold_binary_loc): Move A - (A & B) into ~B & A ...
* match.pd: ... here.
* gcc.dg/fold-minus-7.c: New test.
From-SVN: r225938
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 93dd29d..fa321f4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -9777,30 +9777,6 @@ fold_binary_loc (location_t loc, if (! FLOAT_TYPE_P (type)) { - /* Fold A - (A & B) into ~B & A. */ - if (!TREE_SIDE_EFFECTS (arg0) - && TREE_CODE (arg1) == BIT_AND_EXPR) - { - if (operand_equal_p (arg0, TREE_OPERAND (arg1, 1), 0)) - { - tree arg10 = fold_convert_loc (loc, type, - TREE_OPERAND (arg1, 0)); - return fold_build2_loc (loc, BIT_AND_EXPR, type, - fold_build1_loc (loc, BIT_NOT_EXPR, - type, arg10), - fold_convert_loc (loc, type, arg0)); - } - if (operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0)) - { - tree arg11 = fold_convert_loc (loc, - type, TREE_OPERAND (arg1, 1)); - return fold_build2_loc (loc, BIT_AND_EXPR, type, - fold_build1_loc (loc, BIT_NOT_EXPR, - type, arg11), - fold_convert_loc (loc, type, arg0)); - } - } - /* Fold (A & ~B) - (A & B) into (A ^ B) - B, where B is any power of 2 minus 1. */ if (TREE_CODE (arg0) == BIT_AND_EXPR |