Farooq Mela wrote:
cc -S is your friend.
Right, well that can certainly help, but what gcc generates can be
dependant on calling convention, optimization setting, c c, and
though the code generated in one particular scenario may not be an
absolute indicator of it's behavior. In other words, I was looking for
more of a yes or no type response ;-). Anyway, redirecting this
question to a gcc list.
The correct assembly code to use is dependent on the calling
convention, c, c of the C code you are going to link it
into, so that's not a strong argument.
Given a function argument list and return type, it's going to
remain pretty constant, so long as you compile your -S function
in an isolated environment, such that it has to be capable of
linking against other code, once assembled ...in other words,
you don't have to worry about the peephole optimizer being
able to span multiple object files, so it's not really a
problem that involves changes to calling convetion or tail
call or other optimization.
The answer you were probably looking for is that the eax
register is _not_ loaded with a return value in the void
case, but it may contain a value different than when it
went in, anyway, if the register ended up being used for
scratch.
-- Terry
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message