Commit fe013435 by Paul Brook Committed by Paul Brook

arm-protos.h (arm_load_pic_register): Update prototype.

	* config/arm/arm-protos.h (arm_load_pic_register): Update prototype.
	* config/arm/arm.c (thumb_find_work_register): Update comments.
	(arm_load_pic_register): Add argument for scratch register.
	(arm_expand_prologue, thumb_expand_prologue): Pass extra argument.
	* config/arm/arm.md (builtin_setjmp_receiver): Ditto.

From-SVN: r88982
parent f0ec2b9a
2004-10-13 Paul Brook <paul@codesourcery.com>
* config/arm/arm-protos.h (arm_load_pic_register): Update prototype.
* config/arm/arm.c (thumb_find_work_register): Update comments.
(arm_load_pic_register): Add argument for scratch register.
(arm_expand_prologue, thumb_expand_prologue): Pass extra argument.
* config/arm/arm.md (builtin_setjmp_receiver): Ditto.
2004-10-13 Kazu Hirata <kazu@cs.umass.edu> 2004-10-13 Kazu Hirata <kazu@cs.umass.edu>
* tree-data-ref.c: Fix comment typos. * tree-data-ref.c: Fix comment typos.
...@@ -30,7 +38,7 @@ ...@@ -30,7 +38,7 @@
* gcse.c (remove_reachable_equiv_notes): Use ei_container(). * gcse.c (remove_reachable_equiv_notes): Use ei_container().
2004-10-11 Sebastian Pop <pop@cri.ensmp.fr> 2004-10-11 Sebastian Pop <pop@cri.ensmp.fr>
* Makefile.in (tree-ssa-loop-niter.o): Depends on tree-data-ref.h. * Makefile.in (tree-ssa-loop-niter.o): Depends on tree-data-ref.h.
* cfgloop.c (initialize_loops_parallel_p): New. * cfgloop.c (initialize_loops_parallel_p): New.
(flow_loops_find): Initialize the parallel_p field to true for all (flow_loops_find): Initialize the parallel_p field to true for all
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
extern void arm_override_options (void); extern void arm_override_options (void);
extern int use_return_insn (int, rtx); extern int use_return_insn (int, rtx);
extern int arm_regno_class (int); extern int arm_regno_class (int);
extern void arm_load_pic_register (void); extern void arm_load_pic_register (unsigned int);
extern int arm_volatile_func (void); extern int arm_volatile_func (void);
extern const char *arm_output_epilogue (rtx); extern const char *arm_output_epilogue (rtx);
extern void arm_expand_prologue (void); extern void arm_expand_prologue (void);
......
...@@ -3023,7 +3023,8 @@ thumb_find_work_register (int live_regs_mask) ...@@ -3023,7 +3023,8 @@ thumb_find_work_register (int live_regs_mask)
if (!regs_ever_live[LAST_ARG_REGNUM]) if (!regs_ever_live[LAST_ARG_REGNUM])
return LAST_ARG_REGNUM; return LAST_ARG_REGNUM;
/* Look for a pushed register. */ /* Look for a pushed register. This is used before the frame pointer is
setup, so r7 is a candidate. */
for (reg = LAST_LO_REGNUM; reg >=0; reg--) for (reg = LAST_LO_REGNUM; reg >=0; reg--)
if (live_regs_mask & (1 << reg)) if (live_regs_mask & (1 << reg))
return reg; return reg;
...@@ -3033,10 +3034,11 @@ thumb_find_work_register (int live_regs_mask) ...@@ -3033,10 +3034,11 @@ thumb_find_work_register (int live_regs_mask)
} }
/* Generate code to load the PIC register. */ /* Generate code to load the PIC register. In thumb mode SCRATCH is a
low register. */
void void
arm_load_pic_register (void) arm_load_pic_register (unsigned int scratch)
{ {
#ifndef AOF_ASSEMBLER #ifndef AOF_ASSEMBLER
rtx l1, pic_tmp, pic_tmp2, pic_rtx; rtx l1, pic_tmp, pic_tmp2, pic_rtx;
...@@ -3071,12 +3073,9 @@ arm_load_pic_register (void) ...@@ -3071,12 +3073,9 @@ arm_load_pic_register (void)
{ {
if (REGNO (pic_offset_table_rtx) > LAST_LO_REGNUM) if (REGNO (pic_offset_table_rtx) > LAST_LO_REGNUM)
{ {
int reg;
/* We will have pushed the pic register, so should always be /* We will have pushed the pic register, so should always be
able to find a work register. */ able to find a work register. */
reg = thumb_find_work_register (thumb_compute_save_reg_mask ()); pic_tmp = gen_rtx_REG (SImode, scratch);
pic_tmp = gen_rtx_REG (SImode, reg);
emit_insn (gen_pic_load_addr_thumb (pic_tmp, pic_rtx)); emit_insn (gen_pic_load_addr_thumb (pic_tmp, pic_rtx));
emit_insn (gen_movsi (pic_offset_table_rtx, pic_tmp)); emit_insn (gen_movsi (pic_offset_table_rtx, pic_tmp));
} }
...@@ -10237,7 +10236,7 @@ arm_expand_prologue (void) ...@@ -10237,7 +10236,7 @@ arm_expand_prologue (void)
if (flag_pic) if (flag_pic)
arm_load_pic_register (); arm_load_pic_register (INVALID_REGNUM);
/* If we are profiling, make sure no instructions are scheduled before /* If we are profiling, make sure no instructions are scheduled before
the call to mcount. Similarly if the user has requested no the call to mcount. Similarly if the user has requested no
...@@ -12964,10 +12963,11 @@ thumb_expand_prologue (void) ...@@ -12964,10 +12963,11 @@ thumb_expand_prologue (void)
return; return;
} }
live_regs_mask = thumb_compute_save_reg_mask ();
/* Load the pic register before setting the frame pointer, so we can use r7 /* Load the pic register before setting the frame pointer, so we can use r7
as a temporary work register. */ as a temporary work register. */
if (flag_pic) if (flag_pic)
arm_load_pic_register (); arm_load_pic_register (thumb_find_work_register (live_regs_mask));
offsets = arm_get_frame_offsets (); offsets = arm_get_frame_offsets ();
...@@ -12978,7 +12978,6 @@ thumb_expand_prologue (void) ...@@ -12978,7 +12978,6 @@ thumb_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
} }
live_regs_mask = thumb_compute_save_reg_mask ();
amount = offsets->outgoing_args - offsets->saved_regs; amount = offsets->outgoing_args - offsets->saved_regs;
if (amount) if (amount)
{ {
......
...@@ -4459,7 +4459,9 @@ ...@@ -4459,7 +4459,9 @@
"flag_pic" "flag_pic"
" "
{ {
arm_load_pic_register (); /* r3 is clobbered by set/longjmp, so we can use it as a scratch
register. */
arm_load_pic_register (3);
DONE; DONE;
}") }")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment