Re: Is there stack associated when a executing an inline function?



Kaz Kylheku wrote:
On Feb 29, 11:08 am, jacob navia <ja...@xxxxxxxxxx> wrote:
It would be completely weird that in an inline procedure the compiler
would save the current stack pointer and establish a new stack
frame since there is no function call.

However, it wouldn't be weird at all if the inlined procedure simply
moves the stack pointer by some delta to enlarge the current frame,
then references all of its locals with respect to the current frame,
and then moves the stack pointer back by the same delta upon
termination to release the storage.

That is normal, but that is not a stack frame!

That is just increasing the stack, like when you use
alloca().

That function (alloca()) doesn't create a stack frame.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.



Relevant Pages

  • Re: Is there stack associated when a executing an inline function?
    ... moves the stack pointer by some delta to enlarge the current frame, ... then references all of its locals with respect to the current frame, ...
    (comp.lang.c)
  • Re: Is there stack associated when a executing an inline function?
    ... moves the stack pointer by some delta to enlarge the current frame, ... then references all of its locals with respect to the current frame, ... Multiple inlined functions can use the same stack space without ...
    (comp.lang.c)
  • Re: Is there stack associated when a executing an inline function?
    ... moves the stack pointer by some delta to enlarge the current frame, ... then references all of its locals with respect to the current frame, ...
    (comp.lang.c)
  • Re: need help with stack pointers
    ... subtract the offset value from the current stack pointer value to get the ... You can see evidence of this when the BSR instruction subtracts from the stack pointer as it pushes a return address, and the RTS instruction adds to the stack pointer as it pops that address back into PC. ... So if you're going to establish a frame on "top" of such a stack, you have to avoid the higher addresses which are already in use, and put your frame in locations below the current SP value. ... It would be possible to locate a "frame base" one frame size below the SP value, get that in a register, and index up from there, but that wastes a register for no benefit. ...
    (comp.arch.embedded)
  • Re: Is there stack associated when a executing an inline function?
    ... frame since there is no function call. ... moves the stack pointer by some delta to enlarge the current frame, ... termination to release the storage. ...
    (comp.lang.c)