diff options
author | segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-29 05:44:32 +0000 |
---|---|---|
committer | segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-29 05:44:32 +0000 |
commit | f084f43428d282732bc069dd6148222bf64d8895 (patch) | |
tree | 7b3a30880172d82e63478ec3f74e42ce6e209167 /gcc/combine.c | |
parent | 489f7951e95c68321b024207f252d00cd38001eb (diff) | |
download | gcc-f084f43428d282732bc069dd6148222bf64d8895.tar.gz |
combine: Tweak change_zero_ext
change_zero_ext handles (zero_extend:M1 (subreg:M2 (reg:M1) ...))
already; this patch extends it to also deal with any
(zero_extend:M1 (subreg:M2 (reg:M3) ...)) where the subreg is not
paradoxical.
* combine.c (change_zero_ext): Also handle extends from a subreg
to a mode bigger than that of the operand of the subreg.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 41f69daf7f3..22fb7a97653 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11251,11 +11251,13 @@ change_zero_ext (rtx pat) else if (GET_CODE (x) == ZERO_EXTEND && SCALAR_INT_MODE_P (mode) && GET_CODE (XEXP (x, 0)) == SUBREG - && GET_MODE (SUBREG_REG (XEXP (x, 0))) == mode + && !paradoxical_subreg_p (XEXP (x, 0)) && subreg_lowpart_p (XEXP (x, 0))) { size = GET_MODE_PRECISION (GET_MODE (XEXP (x, 0))); x = SUBREG_REG (XEXP (x, 0)); + if (GET_MODE (x) != mode) + x = gen_lowpart_SUBREG (mode, x); } else if (GET_CODE (x) == ZERO_EXTEND && SCALAR_INT_MODE_P (mode) |