aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-07-31 10:27:42 +0000
committerJeff Law <law@gcc.gnu.org>1999-07-31 04:27:42 -0600
commit6261ede720fc024883ad4942dfbe68f943fe4462 (patch)
tree0120ee57e32ca55e7fbb0d80115e69ccb7c54fd7
parent1984b4afd600495e514daa06a08cd1f9ae44829a (diff)
downloadgcc-6261ede720fc024883ad4942dfbe68f943fe4462.zip
gcc-6261ede720fc024883ad4942dfbe68f943fe4462.tar.gz
gcc-6261ede720fc024883ad4942dfbe68f943fe4462.tar.bz2
pa.c (compute_frame_size): Use STARTINg_FRAME_OFFSET instead of depending on a magic constant value.
* pa.c (compute_frame_size): Use STARTINg_FRAME_OFFSET instead of depending on a magic constant value. Update comments. (hppa_expand_prologue): Similarly. From-SVN: r28356
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/pa/pa.c29
2 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b3c5395..4e51826 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
Sat Jul 31 04:10:01 1999 Jeffrey A Law (law@cygnus.com)
+ * pa.c (compute_frame_size): Use STARTINg_FRAME_OFFSET instead
+ of depending on a magic constant value. Update comments.
+ (hppa_expand_prologue): Similarly.
+
* pa.md (reload_indi, reload_outdi): Allow any register for the
original reload register.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index be9f65e..209976d 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -2593,10 +2593,14 @@ compute_frame_size (size, fregs_live)
extern int current_function_outgoing_args_size;
int i, fsize;
- /* 8 is space for frame pointer + filler. If any frame is allocated
- we need to add this in because of STARTING_FRAME_OFFSET. */
- fsize = size + (size || frame_pointer_needed ? 8 : 0);
+ /* Space for frame pointer + filler. If any frame is allocated
+ we need to add this in because of STARTING_FRAME_OFFSET.
+ Similar code also appears in hppa_expand_prologue. Change both
+ of them at the same time. */
+ fsize = size + (size || frame_pointer_needed ? STARTING_FRAME_OFFSET : 0);
+
+ /* Account for space used by the callee general register saves. */
for (i = 18; i >= 3; i--)
if (regs_ever_live[i])
fsize += UNITS_PER_WORD;
@@ -2604,16 +2608,25 @@ compute_frame_size (size, fregs_live)
/* Round the stack. */
fsize = (fsize + 7) & ~7;
+ /* Account for space used by the callee floating point register saves. */
for (i = 66; i >= 48; i -= 2)
if (regs_ever_live[i] || regs_ever_live[i + 1])
{
if (fregs_live)
*fregs_live = 1;
+ /* We always save both halves of the FP register, so always
+ increment the frame size by 8 bytes. */
fsize += 8;
}
+ /* The various ABIs include space for the outgoing parameters in the
+ size of the current function's stack frame. */
fsize += current_function_outgoing_args_size;
+
+ /* Allocate space for the fixed frame marker. This space must be
+ allocated for any function that makes calls or otherwise allocates
+ stack space. */
if (! leaf_function_p () || fsize)
fsize += 32;
return (fsize + STACK_BOUNDARY - 1) & ~(STACK_BOUNDARY - 1);
@@ -2703,7 +2716,15 @@ hppa_expand_prologue()
gr_saved = 0;
fr_saved = 0;
save_fregs = 0;
- local_fsize = size + (size || frame_pointer_needed ? 8 : 0);
+
+ /* Allocate space for frame pointer + filler. If any frame is allocated
+ we need to add this in because of STARTING_FRAME_OFFSET.
+
+ Similar code also appears in compute_frame_size. Change both
+ of them at the same time. */
+ local_fsize = size + (size || frame_pointer_needed
+ ? STARTING_FRAME_OFFSET : 0);
+
actual_fsize = compute_frame_size (size, &save_fregs);
/* Compute a few things we will use often. */