Commit 8c64be75 by Stan Cox Committed by Stan Cox

* sparc.c (sparc_flat_compute_frame_size): Correctly calc args_size

From-SVN: r23634
parent a49fb37a
Fri Nov 13 11:02:11 1998 Stan Cox <scox@cygnus.com>
* sparc.c (sparc_flat_compute_frame_size): Correctly calc args_size
in a leaf function. Clarify total_size/extra_size relationship.
Thu Nov 12 19:20:57 1998 Geoffrey Noer <noer@cygnus.com> Thu Nov 12 19:20:57 1998 Geoffrey Noer <noer@cygnus.com>
* i386/cygwin32.asm: Delete. * i386/cygwin32.asm: Delete.
......
...@@ -5632,9 +5632,6 @@ sparc_flat_compute_frame_size (size) ...@@ -5632,9 +5632,6 @@ sparc_flat_compute_frame_size (size)
area, and 4 word fp/alu register copy area. */ area, and 4 word fp/alu register copy area. */
extra_size = -STARTING_FRAME_OFFSET + FIRST_PARM_OFFSET(0); extra_size = -STARTING_FRAME_OFFSET + FIRST_PARM_OFFSET(0);
var_size = size; var_size = size;
/* Also include the size needed for the 6 parameter registers. */
args_size = current_function_outgoing_args_size + 24;
total_size = var_size + args_size + extra_size;
gp_reg_size = 0; gp_reg_size = 0;
fp_reg_size = 0; fp_reg_size = 0;
gmask = 0; gmask = 0;
...@@ -5642,6 +5639,14 @@ sparc_flat_compute_frame_size (size) ...@@ -5642,6 +5639,14 @@ sparc_flat_compute_frame_size (size)
reg_offset = 0; reg_offset = 0;
need_aligned_p = 0; need_aligned_p = 0;
args_size = 0;
if (!leaf_function_p ())
{
/* Also include the size needed for the 6 parameter registers. */
args_size = current_function_outgoing_args_size + 24;
}
total_size = var_size + args_size;
/* Calculate space needed for gp registers. */ /* Calculate space needed for gp registers. */
for (regno = 1; regno <= 31; regno++) for (regno = 1; regno <= 31; regno++)
{ {
...@@ -5690,9 +5695,13 @@ sparc_flat_compute_frame_size (size) ...@@ -5690,9 +5695,13 @@ sparc_flat_compute_frame_size (size)
total_size += gp_reg_size + fp_reg_size; total_size += gp_reg_size + fp_reg_size;
} }
/* ??? This looks a little suspicious. Clarify. */ /* If we must allocate a stack frame at all, we must also allocate
if (total_size == extra_size) room for register window spillage, so as to be binary compatible
total_size = extra_size = 0; with libraries and operating systems that do not use -mflat. */
if (total_size > 0)
total_size += extra_size;
else
extra_size = 0;
total_size = SPARC_STACK_ALIGN (total_size); total_size = SPARC_STACK_ALIGN (total_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment