This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Darwin specific 1-liners (1)
- From: Dale Johannesen <dalej at apple dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Richard Henderson <rth at redhat dot com>, Daniel Berlin <dan at cgsoftware dot com>, Stan Shebs <shebs at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 6 Dec 2001 18:02:58 -0800
- Subject: Re: PATCH: Darwin specific 1-liners (1)
On Thursday, December 6, 2001, at 05:41 PM, Dale Johannesen wrote:
> It happens
> only with -fpic (the default). Without -fpic, the instruction that feeds
> into
> the tablejump is an add, not a mov, so the renamer leaves it alone.
Sorry, wrong analysis; the preceding instruction is a mov in both cases.
The reason the substitution doesn't happen without -fpic is just that
the return-address LR is not saved and restored (it's a leaf function),
so that value of LR is live, so LR is not available to the renamer.
-fpic forces PC-relative addressing, which involves a "call" to the next
instruction, which frees LR for reassignment.