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]

Re: Patch to improve x86 prologue


On Wed, Apr 07, 1999 at 06:08:18PM -0400, John Wehle wrote:
> This patch avoids unnecessary aligning of the stack by the prologue.
> The effect of this patch can be seen by compiling:
> 
>   int a;
> 
>   void
>   func(int b)
>     {
> 
>     a = b;
>     }
> 
> with -O2 -S.
This patch is equivalent to one I've sent about week ago.
Problem of this patch is, that leaf_function_p don't work in
ix86_compute_frame_size. I've solved this by adding global variable
and setting it toplev.c

Honza
> 
> ChangeLog:
> 
> Wed Apr  7 18:03:41 EDT 1999  John Wehle  (john@feith.com)
> 
> 	* i386.c (ix86_compute_frame_size): Don't align the stack
> 	for leaf functions which don't have any local variables.
> 
> Enjoy!
> 
> -- John Wehle
> ------------------8<------------------------8<------------------------
> *** gcc/config/i386/i386.c.ORIGINAL	Wed Apr  7 15:01:17 1999
> --- gcc/config/i386/i386.c	Wed Apr  7 17:54:43 1999
> *************** ix86_compute_frame_size (size, nregs_on_
> *** 2016,2021 ****
> --- 2016,2026 ----
>       if (padding < (((offset + preferred_alignment - 1)
>   		    & -preferred_alignment) - offset))
>         padding += preferred_alignment;
> + 
> +     /* Don't bother aligning the stack for leaf functions
> +        which don't have any local variables.  */
> +     if (size == 0 && leaf_function_p ())
> +       padding = 0;
>     }
>   #endif
>   
> -------------------------------------------------------------------------
> |   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
> |    John Wehle    |     Fax: 1-215-540-5495  |                         |
> -------------------------------------------------------------------------

-- 
------------------------------------------------------------------------------
                   Have you browsed my www pages? Look at:
                       http://www.paru.cas.cz/~hubicka
      Koules-the game for Svgalib,X11 and OS/2,  Xonix-the game for X11
      czech documentation for linux index, original 2D computer art and
              funny 100 years old photos and articles are there!


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