This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ARM 2878
- To: gcc-bugs at gcc dot gnu dot org, philb at gnu dot org, mark at codesourcery dot com
- Subject: Re: ARM 2878
- From: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>
- Date: Tue, 12 Jun 2001 00:16:30 +0100
- cc: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
- Reply-To: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
OK, I've had a few minutes to take a quick look at this, and I think the
following will fix it. But I don't have time to test it any further, or to
install the change this week.
Phil, could you give this a whirl and then if Mark is happy install the patch.
Richard.
<date> Richard Earnshaw (reanrsha@arm.com)
* arm.c (arm_reload_in_hi): Handle the scratch operand overlapping
with the output operand.
Index: arm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.c,v
retrieving revision 1.142.2.2
diff -p -p -r1.142.2.2 arm.c
*** arm.c 2001/05/24 21:11:38 1.142.2.2
--- arm.c 2001/06/11 23:04:18
*************** arm_reload_in_hi (operands)
*** 4821,4828 ****
offset = lo;
}
}
- scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
emit_insn (gen_zero_extendqisi2 (scratch,
gen_rtx_MEM (QImode,
plus_constant (base,
--- 4809,4822 ----
offset = lo;
}
}
+
+ /* If the scratch overlaps the output, use the top half of the DImode
+ register we allocated. */
+ 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,