aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2016-11-29 06:44:32 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2016-11-29 06:44:32 +0100
commit452385a7205e963d02890bae566ba523a977c877 (patch)
tree7b3a30880172d82e63478ec3f74e42ce6e209167 /gcc
parentdfed7971fb42cbd5196ee92e27e8292f46fa72e9 (diff)
downloadgcc-452385a7205e963d02890bae566ba523a977c877.zip
gcc-452385a7205e963d02890bae566ba523a977c877.tar.gz
gcc-452385a7205e963d02890bae566ba523a977c877.tar.bz2
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. From-SVN: r242950
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 27f4137..5ef1fcc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2016-11-29 Segher Boessenkool <segher@kernel.crashing.org>
+ * combine.c (change_zero_ext): Also handle extends from a subreg
+ to a mode bigger than that of the operand of the subreg.
+
+2016-11-29 Segher Boessenkool <segher@kernel.crashing.org>
+
PR target/77687
* config/rs6000/rs6000.c (rs6000_emit_stack_reset): Emit the
stack_restore_tie insn instead of stack_tie, for the SVR4 and
diff --git a/gcc/combine.c b/gcc/combine.c
index 41f69da..22fb7a9 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)