diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2015-07-02 18:27:11 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2015-07-02 18:27:11 +0200 |
commit | e62bb796efb2198b7d2ab98c8030c9da7aceeab7 (patch) | |
tree | d174096834a05a5f44f5c2a50ff943b93ef3cce3 | |
parent | 54e378516d0f5f61de13da1c6bdd0884c2b0b5aa (diff) | |
download | gcc-e62bb796efb2198b7d2ab98c8030c9da7aceeab7.zip gcc-e62bb796efb2198b7d2ab98c8030c9da7aceeab7.tar.gz gcc-e62bb796efb2198b7d2ab98c8030c9da7aceeab7.tar.bz2 |
re PR rtl-optimization/66706 (Redundant bitmask instruction on x >> (n & 32))
PR rtl-optimization/66706
* combine.c (make_compound_operation): If an AND of SUBREG of
LSHIFTRT does not simplify, see if just the AND of SUBREG does.
From-SVN: r225344
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/combine.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3b15e2e..c358b6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-02 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/66706 + * combine.c (make_compound_operation): If an AND of SUBREG of + LSHIFTRT does not simplify, see if just the AND of SUBREG does. + 2015-07-02 Alan Lawrence <alan.lawrence@arm.com> * tree-pass.h (make_pass_ch_vect): New. diff --git a/gcc/combine.c b/gcc/combine.c index 8eaae7c..b97aa10 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7893,6 +7893,15 @@ make_compound_operation (rtx x, enum rtx_code in_code) new_rtx = make_extraction (GET_MODE (SUBREG_REG (XEXP (x, 0))), new_rtx, 0, XEXP (SUBREG_REG (XEXP (x, 0)), 1), i, 1, 0, in_code == COMPARE); + + /* If that didn't give anything, see if the AND simplifies on + its own. */ + if (!new_rtx && i >= 0) + { + new_rtx = make_compound_operation (XEXP (x, 0), next_code); + new_rtx = make_extraction (mode, new_rtx, 0, NULL_RTX, i, 1, + 0, in_code == COMPARE); + } } /* Same as previous, but for (xor/ior (lshiftrt...) (lshiftrt...)). */ else if ((GET_CODE (XEXP (x, 0)) == XOR |