This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: MIPS problem with structures/varargs
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: MIPS problem with structures/varargs
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 03 Sep 1999 17:32:09 -0600
- cc: gavin at cygnus dot com, gcc-bugs at gcc dot gnu dot org, wilson at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19990903162148C.mitchell@codesourcery.com>you write:
> >>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:
>
> Jeffrey> Interestingly enough, I think Jason Eckhardt managed to
> Jeffrey> get this working on the PA as part of the PA64 port. The
> Jeffrey> bits seem to appear in the right places, but I haven't
> Jeffrey> done a strict review of the code yet.
>
> Does that mean that the pieces to make this work right are not
> back-end specific? In other words, should I review that work, looking
> to it as a guide for how one might do the MIPS stuff, or is it a
> generic thing that will fix all platforms once and for all?
Each backend will have to be updated.
The PA code is part of the PA64 stuff Cygnus is working on and isn't available
(yet).
Conceptually you do a bitwise copy of the structure from the source memory
location to the destination location in the stack. Then you load up those
items which are supposed to be passed in registers.
The net result is a small struct gets aligned consistently in arg registers
arg stack slots and elsewhere.
For registers the way we do this is to have the function_arg macros return this
ugly looking parallel thingie with a register & an offset. That tells the
machine independent code to store the parameter into a stack slot and to
promote into a register too.
I believe the sparc port might be using this kind of a scheme.
For a big endian machine that results in small structs being left aligned.
That's a generalization of what's going on -- as I mentioned, I haven't
dug into it in great detail yet, but it does require work in the backend
so that it can tell the front-end what to do.
jeff