This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

i386 frame size tweek


We were uselessly aligning the stack frame for leaf functions.
While there was code that thought it was omitting such alignments,
it was thwarted by earlier alignments.


r~

        * i386.c (ix86_compute_frame_size): Omit padding1 if the
        local frame size is zero.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.129
diff -u -p -d -r1.129 i386.c
--- i386.c	2000/01/25 05:59:17	1.129
+++ i386.c	2000/01/30 21:25:41
@@ -1734,7 +1734,6 @@ ix86_compute_frame_size (size, nregs_on_
   int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT;
 
   nregs = ix86_nsaved_regs ();
-
   total_size = size;
 
 #ifdef PREFERRED_STACK_BOUNDARY
@@ -1762,9 +1761,12 @@ ix86_compute_frame_size (size, nregs_on_
     total_size += offset;
 
     /* Align start of frame for local function.  */
-    padding1 = ((offset + stack_alignment_needed - 1)
-		& -stack_alignment_needed) - offset;
-    total_size += padding1;
+    if (size > 0)
+      {
+        padding1 = ((offset + stack_alignment_needed - 1)
+		    & -stack_alignment_needed) - offset;
+        total_size += padding1;
+      }
 
     /* Align stack boundary. */
     if (!current_function_is_leaf)
@@ -1775,10 +1777,8 @@ ix86_compute_frame_size (size, nregs_on_
 
   if (nregs_on_stack)
     *nregs_on_stack = nregs;
-
   if (rpadding1)
     *rpadding1 = padding1;
-
   if (rpadding2)
     *rpadding2 = padding2;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]