Re: 'C' Operators precedence

Richard B. Johnson (
Wed, 20 May 1998 14:57:07 -0400 (EDT)

On Wed, 20 May 1998, David Todd wrote:

> >
> > And this _without_ optimisation. gcc is right to do this; if a function
> > clobbers registers, then let it do so when the variables don't contain
> > anything interersting anyway.
> Umm, the reason why there is a penalty for calling a function
(and why c++ has
> inline functions to avoid the penalty) is because calling a function pushes
> all the registers onto the stack, and restores them afterward.
> --

No, no, no. Only values to be passed to the called function are
pushed onto the stack, then the return address is pushed by the CALL
instruction. If there are no parameters f(void), only the return
address is pushed by the CALL. Upon return, if there were any passed
parameters, the caller levels the stack.

Inline "functions"? You mean macros that expand to inline code, don't

Dick Johnson
Penguin : Linux version 2.1.101 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to