This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stack pointer adjustment problem
- To: schani at mips dot complang dot tuwien dot ac dot at (Mark Probst)
- Subject: Re: stack pointer adjustment problem
- From: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Date: Tue, 27 Feb 2001 00:14:22 +0000 (GMT)
- Cc: gcc at gcc dot gnu dot org
> the reason i want to do such a thing is this: i've been working on
> implementing proper tail calls. to this end i had to implement a new
> calling convention in which the callee pops the arguments. on most
> risc machines, like the alpha, space for outgoing arguments is
> allocated in the prologue of the caller. now, if a function with the
> new calling convention is called (without the call being a proper tail
> call), the stack pointer is modified when the function returns. this
> modification (the popping of the arguments by the callee) has to be
> reverted.
How about explicitly setting the stack pointer to ints new value in
the call insn?
E.g. for call_value:
(call_insn (parallel [(set (reg foo) (call ...))
(set (sp) (plus (sp) (const_int bar)))]))