aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 015637e47aa..2b770581271 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1310,18 +1310,34 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
and IN or CLASS and OUT. Get the icode and push any required reloads
needed for each of them if so. */
+ /* APPLE LOCAL begin restoration of inmode/outmode */
#ifdef SECONDARY_INPUT_RELOAD_CLASS
if (in != 0)
- secondary_in_reload
- = push_secondary_reload (1, in, opnum, optional, class, inmode, type,
- &secondary_in_icode);
+ {
+ secondary_in_reload
+ = push_secondary_reload (1, in, opnum, optional, class, inmode, type,
+ &secondary_in_icode);
+#ifdef TARGET_POWERPC
+ if ( secondary_in_reload != -1 && in_subreg_loc )
+ inmode = GET_MODE (*in_subreg_loc);
+#endif
+ }
+ /* APPLE LOCAL end restoration of inmode/outmode */
#endif
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
+ /* APPLE LOCAL begin restoration of inmode/outmode */
if (out != 0 && GET_CODE (out) != SCRATCH)
- secondary_out_reload
- = push_secondary_reload (0, out, opnum, optional, class, outmode,
- type, &secondary_out_icode);
+ {
+ secondary_out_reload
+ = push_secondary_reload (0, out, opnum, optional, class, outmode,
+ type, &secondary_out_icode);
+#ifdef TARGET_POWERPC
+ if ( secondary_out_reload != -1 && out_subreg_loc )
+ outmode = GET_MODE (*out_subreg_loc);
+#endif
+ }
+ /* APPLE LOCAL end restoration of inmode/outmode */
#endif
/* We found no existing reload suitable for re-use.
@@ -1729,7 +1745,13 @@ combine_reloads (void)
if ((rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& rld[i].opnum == rld[output_reload].opnum)
+ /* APPLE LOCAL begin try destroyed input */
+#ifdef TARGET_POWERPC
+ goto try_destroyed_input;
+#else
return;
+#endif
+ /* APPLE LOCAL end try destroyed input */
/* Check each input reload; can we combine it? */
@@ -1826,6 +1848,11 @@ combine_reloads (void)
that it does not occur in the output (we already know it isn't an
earlyclobber. If this is an asm insn, give up. */
+ /* APPLE LOCAL begin try destroyed input */
+#ifdef TARGET_POWERPC
+ try_destroyed_input:
+#endif
+ /* APPLE LOCAL end try destroyed input */
if (INSN_CODE (this_insn) == -1)
return;
@@ -2159,15 +2186,20 @@ operands_match_p (rtx x, rtx y)
else
j = REGNO (y);
+ /* APPLE LOCAL begin mainline 2005-03-04 */
/* On a WORDS_BIG_ENDIAN machine, point to the last register of a
- multiple hard register group, so that for example (reg:DI 0) and
- (reg:SI 1) will be considered the same register. */
+ multiple hard register group of scalar integer registers, so that
+ for example (reg:DI 0) and (reg:SI 1) will be considered the same
+ register. */
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (x))
&& i < FIRST_PSEUDO_REGISTER)
i += hard_regno_nregs[i][GET_MODE (x)] - 1;
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (y)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (y))
&& j < FIRST_PSEUDO_REGISTER)
j += hard_regno_nregs[j][GET_MODE (y)] - 1;
+ /* APPLE LOCAL end mainline 2005-03-04 */
return i == j;
}