>> getcallerpc:
>>      movl 4(%esp), %eax
>>      movl -4(%eax), %eax
> 
> Just a thought: this is in the GCC function call context, which is
> different from the P9 compilers'.  Does the above still apply?

yes, it does.  standard x86 gcc and plan 9 use the
same conventions for how function arguments get 
passed.

the only difference in calling convention between
gcc's default behavior on x86 platforms and the
plan 9 compilers is that gcc has a few callee-saved
registers, while the plan 9 compilers have none.
i don't know whether, in the gcc port for plan 9,
david changed the register saving conventions to
match plan 9's.  i carefully avoided the issue in the
snippet above, trashing only the return register %eax.

very few programs care if getcallerpc is broken,
and it is never a bottleneck.  if it is really bothering
you, the c function i posted is certainly correct and
avoids writing assembly.

russ

Reply via email to