From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Fresh (relatively speaking) Graphviz From: "Russ Cox" Date: Wed, 5 Mar 2008 15:58:41 -0500 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080305205926.0A2F91E8C52@holo.morphisms.net> Topicbox-Message-UUID: 6fae2360-ead3-11e9-9d60-3106f5b1d025 >> 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