Don't try to reload match_operator

Submitted by Richard Earnshaw on Sept. 17, 2011, 1:31 p.m.

Details

Message ID 4E74A138.1080407@buzzard.freeserve.co.uk
State New
Headers show

Commit Message

Richard Earnshaw Sept. 17, 2011, 1:31 p.m.
This patch fixes a couple of cases where reload incorrectly thinks it
should be messing around with the result of a match_operator operand.
Given that it's never even tried to validate the contents of such an
operand the changes it tries to make are bogus.

This is needed for an upcoming patch I have for improving the code
generated for ARM mul operations.

Tested (along with the forthcoming patch) on arm-eabi.

OK?

R.

<date>  Richard Earnshaw  <rearnsha@arm.com>

	* reload.c (find_reloads): Don't try to reload operands that
	match match_operator.

Patch hide | download patch | download mbox

diff --git a/gcc/reload.c b/gcc/reload.c
index c671765..618b1c0 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3891,7 +3891,8 @@  find_reloads (rtx insn, int replace, int ind_levels, int live_known,
   /* Any constants that aren't allowed and can't be reloaded
      into registers are here changed into memory references.  */
   for (i = 0; i < noperands; i++)
-    if (! goal_alternative_win[i])
+    if (! goal_alternative_win[i]
+	&& ! recog_data.is_operator[i])
       {
 	rtx op = recog_data.operand[i];
 	rtx subreg = NULL_RTX;
@@ -3954,7 +3955,8 @@  find_reloads (rtx insn, int replace, int ind_levels, int live_known,
 
   /* Now record reloads for all the operands that need them.  */
   for (i = 0; i < noperands; i++)
-    if (! goal_alternative_win[i])
+    if (! goal_alternative_win[i]
+	&& ! recog_data.is_operator[i])
       {
 	/* Operands that match previous ones have already been handled.  */
 	if (goal_alternative_matches[i] >= 0)