This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH [i386 windows targets]: Disallow regparm for functionsthat probe stack
- From: Kelley Cook <kcook34 at ford dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Christopher Faylor <cgf at redhat dot com>, Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Date: Mon, 20 Oct 2003 12:44:54 -0400
- Subject: Re: PATCH [i386 windows targets]: Disallow regparm for functionsthat probe stack
- Hop-count: 1
- Reply-to: Kelley Cook <kelleycook at wideopenwest dot com>
> I couldn't find any email about this but I do recall researching what
> needed to be done to fix it.
> It seems like it should be possible to detect the case where EAX is
> live, push it on the stack, and "pop" it after calling
> __chkstk/alloca. It won't be a true, "pop" of course because the
> stack will have been adjusted but it should still be possible to
> retrieve the register, regardless.
I thought about doing this and actually modified cygwin.asm's __alloca
to accomplish this. I think I had it working (at the time PR8750
started failing again, though even that might now work after the recent
cygwin prologue was clean up). Then I realized that it was no better,
and probably worse, than Danny's patch, since the function was doing an
extra push/quasi-pop on %eax just to avoid the "penalty" of having to
push the parameter onto the stack originally.
Which seemed kind of pointless to me.
Kelley Cook