* arm.c (arm_reload_in_hi): Ensure that the scratch register does
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Feb 2003 19:40:11 +0000 (19:40 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Feb 2003 19:40:11 +0000 (19:40 +0000)
not overlap the final result register.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62981 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index a150420..79562ba 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-16 Richard Earnshaw  <rearnsha@arm.com>
+
+       * arm.c (arm_reload_in_hi): Ensure that the scratch register does
+       not overlap the final result register.
+
 2003-02-16 Arend Bayer <arend.bayer@web.de>
           Richard Henderson  <rth@redhat.com>
 
index 2d4f4d8..0847c97 100644 (file)
@@ -5845,7 +5845,14 @@ arm_reload_in_hi (operands)
        }
     }
 
-  scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
+  /* Operands[2] may overlap operands[0] (though it won't overlap
+     operands[1]), that's why we asked for a DImode reg -- so we can
+     use the bit that does not overlap.  */
+  if (REGNO (operands[2]) == REGNO (operands[0]))
+    scratch = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
+  else
+    scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
+
   emit_insn (gen_zero_extendqisi2 (scratch,
                                   gen_rtx_MEM (QImode,
                                                plus_constant (base,