> On 9 Jul 2021, at 09:57, Uros Bizjak <ubiz...@gmail.com> wrote:
>
> On Fri, Jul 9, 2021 at 10:25 AM Iain Sandoe <i...@sandoe.co.uk> wrote:
>>
>> (early) ping;
>> if possible I’d like to get this onto master in time to back-port for 11.2.
>>
>>> On 4 Jul 2021, at 21:08, Iain Sandoe <i...@sandoe.co.uk> wrote:
>>>
>>> Hi,
>>>
>>> (I’m not going to defend the status quo here, it seems a bit prone
>>> to confusing a user [different interposition behaviour between the
>>> inlined and non-inlined cases] however, this is what the platform
>>> compilers implement).
>>>
>>> ----
>>>
>>> We allow public functions defined in a TU to bind locally for PIC
>>> code (the default) on 64bit Mach-O.
>>>
>>> If such functions are not inlined, we cannot tell at compile-time if
>>> they might be called via the lazy symbol resolver (this can depend on
>>> options given at link-time). Therefore, we must assume that the lazy
>>> resolver could be used which clobbers R11 and R10.
>>>
>>> The solution here is similar in form to the one used for veneer regs
>>> on Arm (but I’m open to alternate suggestions).
>>>
>>> tested on X86_64-darwin, linux
>>> OK for master?
>>> Iain
>>>
>>> Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>
>>>
>>> PR target/100152 - [10/11/12 Regression] used caller-saved register not
>>> preserved across a call.
>>>
>>> PR target/100152
>>>
>>> gcc/ChangeLog:
>>>
>>> * config/i386/i386-expand.c (ix86_expand_call): If a call is
>>> to a non-local-binding, or local but to a public symbol, then
>>> assume that it might be indirected via the lazy symbol binder.
>>> Mark R10 and R10 as clobbered in that case.
>
> LGTM, but this is Darwin specific patch, so you could approve it yourself.
thanks, maybe I should have made it “RFC” (I was wondering if there was
any better way to do this). Anyway, I’ll get it in and baking on master.
thanks again,
Iain