This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to improve i386 epilogue (version 4)
- To: John Wehle <john at feith dot com>
- Subject: Re: patch to improve i386 epilogue (version 4)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 08 Oct 1998 01:46:38 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199810080607.CAA13123@jwlab.FEITH.COM>you write:
> [ This version uses life_analysis to determine if the function
> contains calls to other functions. ]
>
> This change allows gcc to skip the loading of the stack pointer
> when it is already known to contain the proper value. This
> optimization is currently only implemented for leaf functions.
>
> ChangeLog:
>
> Thu Oct 8 01:43:29 EDT 1998 John Wehle (john@feith.com)
>
> * flow.c: Update comment.
> (life_analysis_1): Set current_function_has_no_calls.
> * function.c: Define it.
> (init_function_start): Initialize it.
> * output.h: Declare it.
> * i386.c (ix86_epilogue): Optimize the restoring
> of the stack pointer for leaf functions.
This patch effectively makes the stack pointer live at the end of the last
block, but does not show it in the flow data. This is bad. I highly recommend
against it.
At this point I'm not sure about the best way to get this optimization. I'm
tempted to lean towards suggesting someone fix gdb to grok leaf functions
without frame pointers, then allow the x86 port to do frame pointer elimination
for leaf functions.
jeff