Subject: Re: 28.0.50; GC may miss to mark calle safe register content

From: Andrea Corallo <[email-masked]>
Date: Sun, 17 May 2020 19:46:35 +0000

Eli Zaretskii <[email-masked]> writes:

>> Cc: [email-masked], [email-masked]
>> From: Paul Eggert <[email-masked]>
>> Date: Sun, 17 May 2020 12:05:25 -0700
>> 
>> On 5/17/20 10:24 AM, Eli Zaretskii wrote:
>> > I struggle to see
>> > how a Lisp object could appear in a register without leaving any trace
>> > on the stack
>> 
>> Quite easily. It happens all the time. If I do something like this:
>> 
>>     Lisp_Object a = Fcons (b, c);
>>     f (x, y);
>>     return a;
>
> And where's GC in this picture?

GC can be triggered by f or any of his callee it does not matter.

> If it's called directly from 'f', can
> you show me such code in Emacs?  Then we could disassembly it and see
> what we've got.

I'm not sure what we can prove disassembling, that would be just the
result of a specific .c + toolchain + invocation.  I think we want to
have code that is sufficiently portable and safe because correct.

> Usually the code that calls GC is much deeper, and thus the chance of
> that temporary to stay in a register is very small, to say the least.

Probably yes, but I don't think we want to have code that works accidentally.

  Andrea

-- 
[email-masked]