arm.h (CONDITIONAL_REGISTER_USAGE): If flag_pic, never use PIC_OFFSET_TABLE_REGNUM for general alloaction.

* arm.h (CONDITIONAL_REGISTER_USAGE): If flag_pic, never use
PIC_OFFSET_TABLE_REGNUM for general alloaction.
(INITIAL_ELIMINATION_OFFSET): Count the fact that the PIC register
must be stacked if it is used for PIC accesses.
* arm.c (use_return_insn): Handle PIC register specially.
(output_return_instruction): Likewise.
(output_func_{prologue,epilogue}): Likewise.
(output_expand_prologue): Likewise.

From-SVN: r27605
This commit is contained in:
Richard Earnshaw 1999-06-19 05:34:51 +00:00 committed by Richard Earnshaw
parent 62cc72ac04
commit 6ed30148e2
3 changed files with 47 additions and 9 deletions

View File

@ -1,3 +1,14 @@
Sat Jun 19 05:25:05 1999 Richard Earnshaw (rearnsha@arm.com)
* arm.h (CONDITIONAL_REGISTER_USAGE): If flag_pic, never use
PIC_OFFSET_TABLE_REGNUM for general alloaction.
(INITIAL_ELIMINATION_OFFSET): Count the fact that the PIC register
must be stacked if it is used for PIC accesses.
* arm.c (use_return_insn): Handle PIC register specially.
(output_return_instruction): Likewise.
(output_func_{prologue,epilogue}): Likewise.
(output_expand_prologue): Likewise.
Fri Jun 18 23:47:06 1999 David Edelsohn <edelsohn@gnu.org>
* rs6000.c (find_addr_reg): New function.

View File

@ -585,9 +585,14 @@ use_return_insn (iscond)
return 0;
if ((iscond && arm_is_strong)
|| TARGET_THUMB_INTERWORK)
for (regno = 0; regno < 16; regno++)
if (regs_ever_live[regno] && ! call_used_regs[regno])
{
for (regno = 0; regno < 16; regno++)
if (regs_ever_live[regno] && ! call_used_regs[regno])
return 0;
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
return 0;
}
/* Can't be done if any of the FPU regs are pushed, since this also
requires an insn */
@ -5321,6 +5326,9 @@ output_return_instruction (operand, really_return, reverse)
if (regs_ever_live[reg] && ! call_used_regs[reg])
live_regs++;
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
live_regs++;
if (live_regs || (regs_ever_live[14] && ! lr_save_eliminated))
live_regs++;
@ -5340,7 +5348,9 @@ output_return_instruction (operand, really_return, reverse)
reverse ? "ldm%?%D0fd\t%|sp!, {" : "ldm%?%d0fd\t%|sp!, {");
for (reg = 0; reg <= 10; reg++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
if (regs_ever_live[reg]
&& (! call_used_regs[reg]
|| (flag_pic && reg == PIC_OFFSET_TABLE_REGNUM)))
{
strcat (instr, "%|");
strcat (instr, reg_names[reg]);
@ -5500,6 +5510,9 @@ output_func_prologue (f, frame_size)
if (regs_ever_live[reg] && ! call_used_regs[reg])
live_regs_mask |= (1 << reg);
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
live_regs_mask |= (1 << PIC_OFFSET_TABLE_REGNUM);
if (frame_pointer_needed)
live_regs_mask |= 0xD800;
else if (regs_ever_live[14])
@ -5576,6 +5589,12 @@ output_func_epilogue (f, frame_size)
floats_offset += 4;
}
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
{
live_regs_mask |= (1 << PIC_OFFSET_TABLE_REGNUM);
floats_offset += 4;
}
if (frame_pointer_needed)
{
if (arm_fpu_arch == FP_SOFT2)
@ -5836,12 +5855,17 @@ arm_expand_prologue ()
store_arg_regs = 1;
if (! volatile_func)
for (reg = 0; reg <= 10; reg++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
live_regs_mask |= 1 << reg;
{
for (reg = 0; reg <= 10; reg++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
live_regs_mask |= 1 << reg;
if (! volatile_func && regs_ever_live[14])
live_regs_mask |= 0x4000;
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
live_regs_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
if (regs_ever_live[14])
live_regs_mask |= 0x4000;
}
if (frame_pointer_needed)
{

View File

@ -725,7 +725,7 @@ extern const char * structure_size_string;
if (flag_pic) \
{ \
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 0; \
call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
} \
else if (TARGET_APCS_STACK) \
{ \
@ -1262,6 +1262,9 @@ do { \
for (regno = 0; regno <= 10; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
saved_hard_reg = 1, offset += 4; \
/* PIC register is a fixed reg, so call_used_regs set. */ \
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) \
saved_hard_reg = 1, offset += 4; \
for (regno = 16; regno <=23; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
offset += 12; \