summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 07:13:56 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 07:13:56 +0000
commitb17e42301f9d1dfa8879d66fce0c87ac7722ae5d (patch)
tree6da5d9b96b65f4dc9716e0104c3010cbd6600df8 /gcc/config
parentc32202c135c8b81d031829bf16372fe7d5505b8c (diff)
downloadgcc-b17e42301f9d1dfa8879d66fce0c87ac7722ae5d.tar.gz
* config/i386/i386.c (ix86_expand_prologue): If the function uses a
frame pointer, restore eax with an ebp-relative address. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85595 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 5b37ea8aeb8..f05ff5e5ede 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5399,7 +5399,14 @@ ix86_expand_prologue (void)
if (eax_live)
{
- rtx t = plus_constant (stack_pointer_rtx, allocate);
+ rtx t;
+ if (frame_pointer_needed)
+ t = plus_constant (hard_frame_pointer_rtx,
+ allocate
+ - frame.to_allocate
+ - frame.nregs * UNITS_PER_WORD);
+ else
+ t = plus_constant (stack_pointer_rtx, allocate);
emit_move_insn (eax, gen_rtx_MEM (SImode, t));
}
}