Subject: Re: bug#76559: 31.0.50; [-O3 + PGTK] Crash when 'copying as kill'/'killing word'

From: Pip Cet <[email-masked]>
Date: Thu, 27 Feb 2025 12:22:36 +0000

"Eli Zaretskii" <[email-masked]> writes:

>> From: Po Lu <[email-masked]>
>> Cc: Iurie Marian <[email-masked]>,  [email-masked],
>>   [email-masked],  [email-masked]
>> Date: Thu, 27 Feb 2025 13:36:59 +0800
>>
>> Eli Zaretskii <[email-masked]> writes:
>>
>> >  Po Lu, any suggestions or ideas?
>>
>> I replied to Pip Cet.  It's likely a GCC bug, and one which I cannot
>> reproduce in 14.2.1 or the recentest GCC 15 snapshot, rather than
>> undefined behavior in any sense...

(I'm not convinced there's a GCC bug there, but it doesn't matter:
aggressive GCC optimizations currently result in broken Emacs builds).

> Thanks.
>
> I believe we should recommend against using -O3.  Too many bad bugs

If we do that, can we include link time optimization in that?  I find
LTO'd code extremely difficult to read, since things like the calling
convention no longer apply (even when a function call isn't inlined, LTO
can still conclude that some registers survive the call and reuse them
even though the calling convention disagrees).

However, let's be careful not to blame GCC until we have a smoking gun.
So far, it's usually Emacs which is at fault.

Pip