From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199605081753.KAA24010@web.azstarnet.com> Date: Wed, 8 May 1996 10:53:13 -0700 (MST) From: David Mosberger Subject: Re: gdb But if somebody starts to work on the linker optimizations proposed by Linus, do keep in mind that the calling convention requires $27 (pv) to point to the starting address of the called function. It is possible to avoid having to load $27 but only if the global pointer register has the same value in the caller and the callee. In that case, you'd have to skip the prologue code that establishes the gp (normally the first two instructions). I know this is an old hat, but it keeps biting people... --david PS: Not to give the wrong impression: the optimization looks *very* promising and I think it's well worth doing. Even if you can't get rid of the load of $27, it still is preferable to use a bsr instruction since it won't have a data dependency on the load of $27 and since it is always predicted correctly. A final note: OSF/1's linker does this kind of optimizations when using the -om flag (and possibly others, I forget). It may be worthwhile to play with that a little to get a feeling of what would have the biggest payoff.