+2005-08-19 Richard Earnshaw <richard.earnshaw@arm.com>
+
+ PR target/23473
+ * arm.md (arm_load_pic_register): Change argument to the mask of
+ saved registers. Call thumb_find_work_register if we need a
+ scratch register on Thumb.
+ (arm_expand_prologue): Pass empty register set to
+ arm_load_pic_register.
+ (thumb_expand_prologue): Pass live_regs_mask directly to
+ arm_load_pic_register.
+ * arm-protos.h (arm_load_pic_register): Update prototype.
+
2005-08-19 J"orn Rennecke <joern.rennecke@st.com>
* sh.c (find_sole_member): New function.
extern void arm_override_options (void);
extern int use_return_insn (int, rtx);
extern int arm_regno_class (int);
-extern void arm_load_pic_register (unsigned int);
+extern void arm_load_pic_register (unsigned long);
extern int arm_volatile_func (void);
extern const char *arm_output_epilogue (rtx);
extern void arm_expand_prologue (void);
low register. */
void
-arm_load_pic_register (unsigned int scratch)
+arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
{
#ifndef AOF_ASSEMBLER
rtx l1, pic_tmp, pic_tmp2, pic_rtx;
{
if (REGNO (pic_offset_table_rtx) > LAST_LO_REGNUM)
{
- /* We will have pushed the pic register, so should always be
+ /* We will have pushed the pic register, so we should always be
able to find a work register. */
- pic_tmp = gen_rtx_REG (SImode, scratch);
+ pic_tmp = gen_rtx_REG (SImode,
+ thumb_find_work_register (saved_regs));
emit_insn (gen_pic_load_addr_thumb (pic_tmp, pic_rtx));
emit_insn (gen_movsi (pic_offset_table_rtx, pic_tmp));
}
if (flag_pic)
- arm_load_pic_register (INVALID_REGNUM);
+ arm_load_pic_register (0UL);
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. Similarly if the user has requested no
/* Load the pic register before setting the frame pointer,
so we can use r7 as a temporary work register. */
if (flag_pic)
- arm_load_pic_register (thumb_find_work_register (live_regs_mask));
+ arm_load_pic_register (live_regs_mask);
offsets = arm_get_frame_offsets ();