diff options
author | Richard Biener <rguenther@suse.de> | 2015-07-07 14:12:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-07-07 14:12:44 +0000 |
commit | 98e30e515f184bd63196d4d500a682fbfeb9635e (patch) | |
tree | daaaff74c7d6229017ab98b9e6dc9cbfc072a51c /gcc/fold-const.c | |
parent | ddae3477d446e1f93b62b7cb2880f75216e85ce8 (diff) | |
download | gcc-98e30e515f184bd63196d4d500a682fbfeb9635e.zip gcc-98e30e515f184bd63196d4d500a682fbfeb9635e.tar.gz gcc-98e30e515f184bd63196d4d500a682fbfeb9635e.tar.bz2 |
fold-const.c (fold_binary_loc): Move (X & C2) << C1 -> (X << C1) & (C2 << C1) simplification ...
2015-07-07 Richard Biener <rguenther@suse.de>
* fold-const.c (fold_binary_loc): Move
(X & C2) << C1 -> (X << C1) & (C2 << C1) simplification ...
* match.pd: ... here.
Add (X * C1) % C2 -> 0 simplification pattern derived from
extract_muldiv_1.
* gcc.dg/vect/vect-over-widen-3-big-array.c: Adjust.
From-SVN: r225517
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index d896d7a..23ef423 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -11194,27 +11194,6 @@ fold_binary_loc (location_t loc, prec) == 0) return TREE_OPERAND (arg0, 0); - /* Fold (X & C2) << C1 into (X << C1) & (C2 << C1) - (X & C2) >> C1 into (X >> C1) & (C2 >> C1) - if the latter can be further optimized. */ - if ((code == LSHIFT_EXPR || code == RSHIFT_EXPR) - && TREE_CODE (arg0) == BIT_AND_EXPR - && TREE_CODE (arg1) == INTEGER_CST - && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST) - { - tree mask = fold_build2_loc (loc, code, type, - fold_convert_loc (loc, type, - TREE_OPERAND (arg0, 1)), - arg1); - tree shift = fold_build2_loc (loc, code, type, - fold_convert_loc (loc, type, - TREE_OPERAND (arg0, 0)), - arg1); - tem = fold_binary_loc (loc, BIT_AND_EXPR, type, shift, mask); - if (tem) - return tem; - } - return NULL_TREE; case MIN_EXPR: |