aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-09-16 00:38:00 +0000
committerJeff Law <law@gcc.gnu.org>1999-09-15 18:38:00 -0600
commitdd8c13e38722b002cbc000a73ba539a7eedbc496 (patch)
tree7e57ad98468c6001cc2b07f50d6ee76c537b3e43 /gcc
parent5019d7a7f06217a19edf434fca2d91590dee5351 (diff)
downloadgcc-dd8c13e38722b002cbc000a73ba539a7eedbc496.zip
gcc-dd8c13e38722b002cbc000a73ba539a7eedbc496.tar.gz
gcc-dd8c13e38722b002cbc000a73ba539a7eedbc496.tar.bz2
pa.c (emit_move_sequence): Properly set the mode of the scratch register when...
* pa.c (emit_move_sequence): Properly set the mode of the scratch register when performing secondary reloads for the SAR register. From-SVN: r29446
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/pa/pa.c29
2 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a6299be..39930f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 15 18:35:38 1999 Jeffrey A Law (law@cygnus.com)
+
+ * pa.c (emit_move_sequence): Properly set the mode of the scratch
+ register when performing secondary reloads for the SAR register.
+
Wed Sep 15 15:51:52 1999 Mark Mitchell <mark@codesourcery.com>
* rtl.h (NOTE_BLOCK_NUMBER): Replace with ...
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 40054cf..773c0c7 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -1288,16 +1288,15 @@ emit_move_sequence (operands, mode, scratch_reg)
&& FP_REG_CLASS_P (REGNO_REG_CLASS (REGNO (operand1)))))
&& scratch_reg)
{
- /* SCRATCH_REG will hold an address and maybe the actual data. We want
- it in WORD_MODE regardless of what mode it was originally given
- to us. */
- scratch_reg = gen_rtx_REG (word_mode, REGNO (scratch_reg));
-
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
if (GET_CODE (operand1) == MEM
&& !memory_address_p (Pmode, XEXP (operand1, 0)))
{
+ /* We are reloading the address into the scratch register, so we
+ want to make sure the scratch register is a full register. */
+ scratch_reg = gen_rtx_REG (word_mode, REGNO (scratch_reg));
+
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1,
0)),
@@ -1305,11 +1304,27 @@ emit_move_sequence (operands, mode, scratch_reg)
XEXP (XEXP (operand1, 0),
0),
scratch_reg));
- emit_move_insn (scratch_reg, gen_rtx_MEM (GET_MODE (operand1),
+
+ /* Now we are going to load the scratch register from memory,
+ we want to load it in the same width as the original MEM,
+ which must be the same as the width of the ultimate destination,
+ OPERAND0. */
+ scratch_reg = gen_rtx_REG (GET_MODE (operand0), REGNO (scratch_reg));
+
+ emit_move_insn (scratch_reg, gen_rtx_MEM (GET_MODE (operand0),
scratch_reg));
}
else
- emit_move_insn (scratch_reg, operand1);
+ {
+ /* We want to load the scratch register using the same mode as
+ the ultimate destination. */
+ scratch_reg = gen_rtx_REG (GET_MODE (operand0), REGNO (scratch_reg));
+ emit_move_insn (scratch_reg, operand1);
+ }
+
+ /* And emit the insn to set the ultimate destination. We know that
+ the scratch register has the same mode as the destination at this
+ point. */
emit_move_insn (operand0, scratch_reg);
return 1;
}