diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2003-02-16 19:40:11 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2003-02-16 19:40:11 +0000 |
commit | 3a1944a6027742b55618cf0105e190f2023786ff (patch) | |
tree | 216fe3a2ed69ac9451b3ce3f76b4e73a77d9957e | |
parent | 97a6e368a615e1f299ac31e79b00a2a4d337ea27 (diff) | |
download | gcc-3a1944a6027742b55618cf0105e190f2023786ff.zip gcc-3a1944a6027742b55618cf0105e190f2023786ff.tar.gz gcc-3a1944a6027742b55618cf0105e190f2023786ff.tar.bz2 |
arm.c (arm_reload_in_hi): Ensure that the scratch register does not overlap the final result register.
* arm.c (arm_reload_in_hi): Ensure that the scratch register does
not overlap the final result register.
From-SVN: r62981
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a150420..79562ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 2d4f4d8..0847c97 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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, |