* config/i386/i386.c (ix86_compute_frame_layout): Do not add
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 May 2002 20:27:45 +0000 (20:27 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 May 2002 20:27:45 +0000 (20:27 +0000)
        bottom alignment for leaf functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53965 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index 356c1b6..54e828f 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-28  Richard Henderson  <rth@redhat.com>
+
+       * config/i386/i386.c (ix86_compute_frame_layout): Do not add
+       bottom alignment for leaf functions.
+
 2002-05-28  Zack Weinberg  <zack@codesourcery.com>
 
        * config/pa/milli32.S, config/pa/lib1funcs.asm,
index cf2def2..39831af 100644 (file)
@@ -4138,8 +4138,9 @@ ix86_compute_frame_layout (frame)
 
   offset += size;
 
-  /* Add outgoing arguments area.  */
-  if (ACCUMULATE_OUTGOING_ARGS)
+  /* Add outgoing arguments area.  Can be skipped if we eliminated
+     all the function calls as dead code.  */
+  if (ACCUMULATE_OUTGOING_ARGS && !current_function_is_leaf)
     {
       offset += current_function_outgoing_args_size;
       frame->outgoing_arguments_size = current_function_outgoing_args_size;
@@ -4147,9 +4148,12 @@ ix86_compute_frame_layout (frame)
   else
     frame->outgoing_arguments_size = 0;
 
-  /* Align stack boundary.  */
-  frame->padding2 = ((offset + preferred_alignment - 1)
-                    & -preferred_alignment) - offset;
+  /* Align stack boundary.  Only needed if we're calling another function.  */
+  if (!current_function_is_leaf)
+    frame->padding2 = ((offset + preferred_alignment - 1)
+                      & -preferred_alignment) - offset;
+  else
+    frame->padding2 = 0;
 
   offset += frame->padding2;