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 2)
- To: law at cygnus dot com
- Subject: Re: patch to improve i386 epilogue (version 2)
- From: John Wehle <john at feith dot com>
- Date: Tue, 29 Sep 1998 02:06:13 -0400 (EDT)
- cc: egcs-patches at cygnus dot com
> Thinking this through a little, it also occurs to me that you might
> just be able to look at whether or not the stack pointer is live at
> entry to the last basic block.
>
> In fact, that might be the best solution. The nice thing is it keeps
> flow.c and the epilogue code in sync (which is very important from a
> correctness standpoint).
Currently the stack pointer isn't marked as alive (though the frame pointer
is) at entry to any basic blocks when compiling a leaf function on the i386
unless -fomit-frame-pointer is being used in which case all this is moot.
At least that's what I see from the rtl dump after flow has run when using
-da -S -O to compile:
int
subr1(int a, int b)
{
int c;
int d;
int e;
int f;
int g;
int i;
c = a;
d = b;
g = 0;
for (i = c; i < d; i++) {
e = c / d;
f = c % d;
c = e;
d = f;
g += c - d;
}
if (g != g)
{
printf("g != g\n");
for ( ; ; )
printf("g != g\n");
}
return g;
}
I'll probably just submit a new patch based on checking for function calls
during life analysis (as was discussed previously).
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------