This is the mail archive of the
mailing list for the GCC project.
Re: Register-passed arguments copied to the stack?
> > But the callee makes something weird: at the beginning of the function,
> > it copies all the arguments it received on the stack instead of directly
> > using the register arguments.
> There are a number of reasons why this might happen. Try stepping
> through the code in assign_parms in function.c to see why parameters get
> copied into either a pseudo or a stack slot.
Just seen it - you're right, register arguments always end up in the stack
> Are you compiling with optimization? You didn't mention compilation
> options anywhere. If you are compiling unoptimized, then yes, the
> parameter are supposed to be copied into stack slots.
I'm not using optimization - it's just that the behavior I'd like gcc to have
is to use a certain class of registers to manipulate arguments. Since this
class of registers is only used for this purpose, it doesn't need to save it
by copying the arguments on the stack. I wanted that because I need to map
the GCC representation to my abstract model. It's much easier to recognize an
argument by a register number than by a stack entry. You can see this mail if
you want more details: http://gcc.gnu.org/ml/gcc/2003-08/msg01321.html
So eventually it looks like there is no way to do this - I'll try to deal with
stack entries, but it will produce sub-optimal code for my target.