* config/xtensa/xtensa.md (reload<mode>_literal): Handle MEM operands.
authorBob Wilson <bob.wilson@acm.org>
Sat, 20 Sep 2008 02:43:00 +0000 (02:43 +0000)
committerBob Wilson <bwilson@gcc.gnu.org>
Sat, 20 Sep 2008 02:43:00 +0000 (02:43 +0000)
From-SVN: r140509

gcc/ChangeLog
gcc/config/xtensa/xtensa.md

index 2c39599..a56d27e 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-19  Bob Wilson  <bob.wilson@acm.org>
+       
+       * config/xtensa/xtensa.md (reload<mode>_literal): Handle MEM operands.
+       
 2008-09-19  Ian Lance Taylor  <iant@google.com>
 
        * varasm.c (narrowing_initializer_constant_valid_p): Return
index 29119ed..abaf29d 100644 (file)
   rtx lit, scratch;
   unsigned word_off, byte_off;
 
-  gcc_assert (GET_CODE (operands[1]) == SUBREG);
-  lit = SUBREG_REG (operands[1]);
-  scratch = operands[2];
-  word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1);
-  byte_off = SUBREG_BYTE (operands[1]) - word_off;
+  if (MEM_P (operands[1]))
+    {
+      lit = operands[1];
+      word_off = 0;
+      byte_off = 0;
+    }
+  else
+    {
+      gcc_assert (GET_CODE (operands[1]) == SUBREG);
+      lit = SUBREG_REG (operands[1]);
+      word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1);
+      byte_off = SUBREG_BYTE (operands[1]) - word_off;
+    }
 
   lit = adjust_address (lit, SImode, word_off);
+  scratch = operands[2];
   emit_insn (gen_movsi (scratch, lit));
   emit_insn (gen_mov<mode> (operands[0],
                            gen_rtx_SUBREG (<MODE>mode, scratch, byte_off)));