This is the mail archive of the
mailing list for the GCC project.
Re: [Patch x86/darwin] fix PR51784 'PIC register not correctly preserved...'
- From: Iain Sandoe <iain at codesourcery dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 18 Jul 2013 08:39:29 +0100
- Subject: Re: [Patch x86/darwin] fix PR51784 'PIC register not correctly preserved...'
- References: <CAFULd4YcXdgkE5mH052fkR3NZErj2yaG5UNo6EmMUFWUqUu36A at mail dot gmail dot com>
(working on a re-vamp with an expander for the nonlocal goto MD).
On 18 Jul 2013, at 08:26, Uros Bizjak wrote:
> Under assumpiton that foo and bar doesn't share the same GOT, you will
> see that g42 after the label is accessed with "clobbered" %ebx.
My understanding is that foo and bar *have* have to share the same GOT (since they must be in the same object).
It is only foo and its caller that would have different GOTs.
Note, however, that IFF EBX might be used in foo() for some other purpose (i.e. such that its value is not the GOT and needs to be preserved across the call to bar()) then we have a more general problem - i.e. that x86 needs some general way to restore ebx at the site of a non-local-goto-reciever. I don't think it works to restore ebx inside bar() since the goto might not be to bar()'s caller.
e.g. in Jakub's example in the PR.