summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjrv <jrv@138bc75d-0d04-0410-961f-82ee72b054a4>1992-03-28 06:33:41 +0000
committerjrv <jrv@138bc75d-0d04-0410-961f-82ee72b054a4>1992-03-28 06:33:41 +0000
commitcd52197afd6ad5412f774dafa065d2baa08994c9 (patch)
tree44dfd289059e790b5ad3d744f693271a5e5500c3
parentbbaca70268f95ae8c1f578b5609d3871c2567efb (diff)
downloadgcc-cd52197afd6ad5412f774dafa065d2baa08994c9.tar.gz
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@609 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/i386/i386.c23
-rw-r--r--gcc/output.h3
2 files changed, 15 insertions, 11 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3fdd4060689..21eee4845b9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -614,6 +614,8 @@ function_prologue (file, size)
register int regno;
int limit;
rtx xops[4];
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool);
xops[0] = stack_pointer_rtx;
xops[1] = frame_pointer_rtx;
@@ -639,14 +641,13 @@ function_prologue (file, size)
limit = (frame_pointer_needed ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
for (regno = limit - 1; regno >= 0; regno--)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
xops[0] = gen_rtx (REG, SImode, regno);
output_asm_insn ("push%L0 %0", xops);
}
- if (current_function_uses_pic_offset_table)
+ if (pic_reg_used)
{
xops[0] = pic_offset_table_rtx;
xops[1] = (rtx) gen_label_rtx ();
@@ -675,6 +676,8 @@ simple_386_epilogue ()
int nregs = 0;
int reglimit = (frame_pointer_needed
? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool);
#ifdef NON_SAVING_SETJMP
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
@@ -686,8 +689,7 @@ simple_386_epilogue ()
for (regno = reglimit - 1; regno >= 0; regno--)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
nregs++;
return nregs == 0 || ! frame_pointer_needed;
@@ -706,6 +708,8 @@ function_epilogue (file, size)
register int nregs, limit;
int offset;
rtx xops[3];
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool);
/* Compute the number of registers to pop */
@@ -717,8 +721,7 @@ function_epilogue (file, size)
for (regno = limit - 1; regno >= 0; regno--)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
nregs++;
/* sp is often unreliable so we must go off the frame pointer,
@@ -744,8 +747,7 @@ function_epilogue (file, size)
for (regno = 0; regno < limit; regno++)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
xops[0] = gen_rtx (REG, SImode, regno);
output_asm_insn ("pop%L0 %0", xops);
@@ -754,8 +756,7 @@ function_epilogue (file, size)
else
for (regno = 0; regno < limit; regno++)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
xops[0] = gen_rtx (REG, SImode, regno);
xops[1] = adj_offsettable_operand (AT_BP (Pmode), offset);
diff --git a/gcc/output.h b/gcc/output.h
index edf68ffed34..303b1da19bd 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -138,6 +138,9 @@ extern int flag_pic;
/* This is nonzero if the current function uses pic_offset_table_rtx. */
extern int current_function_uses_pic_offset_table;
+/* This is nonzero if the current function uses the constant pool. */
+extern int current_function_uses_const_pool;
+
/* The line number of the beginning of the current function.
sdbout.c needs this so that it can output relative linenumbers. */