This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1 status
- To: law at cygnus dot com, Andi Kleen <ak at muc dot de>
- Subject: Re: egcs-1.1 status
- From: Andi Kleen <ak at muc dot de>
- Date: Sun, 23 Aug 1998 05:03:27 +0200
- Cc: Linus Torvalds <torvalds at transmeta dot com>, "H.J. Lu" <hjl at lucon dot org>, manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de, egcs at cygnus dot com
- References: <19980823032940.A4165@kali.lrz-muenchen.de> <6528.903840145@hurl.cygnus.com>
On Sun, Aug 23, 1998 at 04:42:25AM +0200, Jeffrey A Law wrote:
>
> In message <19980823032940.A4165@kali.lrz-muenchen.de>you write:
> > How about something like
> >
> > register void *arga asm("eax");
> > register void *argb asm("ebx");
> >
> > void switch_to(void)
> > {
> > /* use arga and argb */
> > }
> >
> > Could this work?
> The important issue is argument setup on the caller side, not the
> callee side.
In the __switch_to case this is done by a assembly function, and thus no
problem. The question is only whether it can be told to gcc reliably
that it should expect the variables in these registers.
I recognize that it is not nice because it prevents lots of optimizations
(possible solved by using local fixed register variables instead, is it
guranteed that these registers won't be thrashed between function entry
and first use?)
Another problem of the global register variables is that the function would
needs to be put into an own file, or at least at the end another one, otherwise
the functions after it would generate horrible code.
Regarding the problem of eax as the return value registers: when all
functions used in __switch_to() are inlined, and __switch_to() itself
is a void, would that solve the problem?
-Andi