Hey folks, My colleague Nicolas Savoire created a compiler reproducer[0] for the effect -- you can see a side-by-side comparison of code compiled with GCC 8.x and 9.x where 8.x emits fmov instructions and 9.x does not. He further used this example as a git bisect criteria and eventually found the relevant-looking commit[1] that changed the register allocator to no longer recruit FP registers for pointer storage.
Mostly posting this as additional information for anyone that might stumble across this in the future, no questions at the moment :-) Attila. -- [0]: https://godbolt.org/z/fbqdjarYx [1]: https://github.com/gcc-mirror/gcc/commit/2eb2847ec54a3262f303f47697c5e5cbe3cc089d On Mon, Feb 24, 2025 at 9:48 AM Attila Szegedi <attila.szeg...@datadoghq.com> wrote: > On Mon, Feb 24, 2025 at 1:21 PM Florian Weimer <f...@deneb.enyo.de> wrote: > >> * Attila Szegedi: >> >> >> That seems … quite unlikely. GCC 8 has seen extensive use on >> >> AArch64, on a variety of implementations, and I don't recall >> >> problems in this area. I don't follow AArch64 *that* closely, >> >> admittedly, but I expect it would have caused quite a ruckus. >> >> >> > >> > Yeah. The lack of discussion also led me to believe that even if this >> is an >> > issue, it's definitely not a widely encountered one. (It's also possible >> > that it's a red herring, although, well, as I said, forcing general regs >> > only did fix it.) >> >> Is it non-deterministic? It might be a context switching issue in the >> kernel/hypervisor/firmware. I usually don't notice fixes for those >> because they do not lead to questions whether it's necessary to >> rebuild the whole distribution. These bugs do happen from time to time: >> >> [PATCH v3 0/8] KVM: arm64: FPSIMD/SVE/SME fixes >> < >> https://lore.kernel.org/linux-arm-kernel/20250210195226.1215254-1-mark.rutl...@arm.com/ >> > >> > > Huh. That is interesting. Yes, it is non-deterministic. And it does occur > solely in containerized environments, so it's eminently possible it's a > hypervisor issue. > > (Still, a bit amusing that nothing came up with regard to how I don't see > GCC 12 schedule pointers onto aarch64 FP registers anymore :-). I > understood from Kyrylo's post that it's probably because no such explicit > decision was made.) > > Attila. >