[backport from gcc-4.7/trunk, PR46603 fix part 1 of 3 ] gcc/ 2011-10-25 Eric Botcazou PR rtl-optimization/46603 * reload.c (push_reload): In the out case, reload the subreg as well as the reg if it has word mode. gcc/testsuite/ 2011-10-25 Eric Botcazou * gcc.dg/vect/slp-multitypes-2.c: Do not XFAIL on SPARC 32-bit. --- gcc-4.6.2/gcc/reload.c.~1~ 2011-06-17 13:13:38.000000000 +0200 +++ gcc-4.6.2/gcc/reload.c 2011-11-05 13:11:37.000000000 +0100 @@ -1114,10 +1114,10 @@ push_reload (rtx in, rtx out, rtx *inloc /* Similarly for paradoxical and problematical SUBREGs on the output. Note that there is no reason we need worry about the previous value - of SUBREG_REG (out); even if wider than out, - storing in a subreg is entitled to clobber it all - (except in the case of STRICT_LOW_PART, - and in that case the constraint should label it input-output.) */ + of SUBREG_REG (out); even if wider than out, storing in a subreg is + entitled to clobber it all (except in the case of a word mode subreg + or of a STRICT_LOW_PART, in that latter case the constraint should + label it input-output.) */ if (out != 0 && GET_CODE (out) == SUBREG && (subreg_lowpart_p (out) || strict_low) #ifdef CANNOT_CHANGE_MODE_CLASS @@ -1138,16 +1138,6 @@ push_reload (rtx in, rtx out, rtx *inloc / UNITS_PER_WORD))) #endif )) - || (REG_P (SUBREG_REG (out)) - && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER - && ((GET_MODE_SIZE (outmode) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - > UNITS_PER_WORD) - && ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - / UNITS_PER_WORD) - != (int) hard_regno_nregs[REGNO (SUBREG_REG (out))] - [GET_MODE (SUBREG_REG (out))])) - || ! HARD_REGNO_MODE_OK (subreg_regno (out), outmode))) || (secondary_reload_class (0, rclass, outmode, out) != NO_REGS && (secondary_reload_class (0, rclass, GET_MODE (SUBREG_REG (out)), SUBREG_REG (out)) --- gcc-4.6.2/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c.~1~ 2011-03-21 11:09:10.000000000 +0100 +++ gcc-4.6.2/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c 2011-11-05 13:11:37.000000000 +0100 @@ -1,5 +1,4 @@ /* { dg-require-effective-target vect_int } */ -/* { dg-xfail-run-if "PR rtl-optimization/46603" { sparc*-*-* && { ilp32 && gas } } } */ #include #include "tree-vect.h"