diff options
author | Jeff Law <law@gcc.gnu.org> | 1994-08-14 19:55:59 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1994-08-14 19:55:59 -0600 |
commit | 2ebb1b42179408831331556fb977d188eb2f3574 (patch) | |
tree | d59dede69e200d64a30f7c9afba75ece58b27ee7 /gcc | |
parent | 40e81af5f03b079ca6d0dfefc5e5f13241b66271 (diff) | |
download | gcc-2ebb1b42179408831331556fb977d188eb2f3574.zip gcc-2ebb1b42179408831331556fb977d188eb2f3574.tar.gz gcc-2ebb1b42179408831331556fb977d188eb2f3574.tar.bz2 |
pa.c (hppa_expand_prologue): Avoid writing outside the current stack boundary in code to handle large stack...
* pa.c (hppa_expand_prologue): Avoid writing outside the current
stack boundary in code to handle large stack frames.
From-SVN: r7926
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pa/pa.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 2ec1d8b..6adca1b 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -2090,10 +2090,18 @@ hppa_expand_prologue() size_rtx, tmpreg)); else { - store_reg (1, 0, FRAME_POINTER_REGNUM); + /* It is incorrect to store the saved frame pointer at *sp, + then increment sp (writes beyond the current stack boundary). + + So instead use stwm to store at *sp and post-increment the + stack pointer as an atomic operation. Then increment sp to + finish allocating the new frame. */ + emit_insn (gen_post_stwm (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (64), tmpreg)); set_reg_plus_d (STACK_POINTER_REGNUM, STACK_POINTER_REGNUM, - actual_fsize); + actual_fsize - 64); } } /* no frame pointer needed. */ |