Re: GCC used to store pointers in FP registers on aarch64

2025-02-24 Thread Mark Rutland via Gcc
On Mon, Feb 24, 2025 at 10:46:42AM +0100, Attila Szegedi wrote: > Hi folks, Hi, I've been pointed at this thread due to the reference to my Linux patch series fixing some KVM FPSIMD/SVE/SME issues. > I'm looking for a bit of a historic context for a fun GCC behavior we > stumbled across. For...

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-11 Thread Mark Rutland via Gcc
On Tue, Apr 05, 2022 at 01:51:30PM +0100, Mark Rutland wrote: > Hi all, > > [adding kernel folk who work on asm stuff] > > As a heads-up, GCC 12 (not yet released) appears to erroneously optimize away > calls to functions with volatile asm. Szabolcs has raised an issue on the GCC > bugzilla: >

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-11 Thread Mark Rutland via Gcc
On Tue, Apr 05, 2022 at 04:05:22PM +0200, Peter Zijlstra wrote: > On Tue, Apr 05, 2022 at 01:51:30PM +0100, Mark Rutland wrote: > > Hi all, > > > > [adding kernel folk who work on asm stuff] > > > > As a heads-up, GCC 12 (not yet released) appears to erroneously optimize > > away > > calls to fu

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Mark Rutland via Gcc
Sorry, I copied the wrong version of the x86_64 assembly as generated by GCC 11.2.0). Updated below. On Tue, Apr 05, 2022 at 01:51:30PM +0100, Mark Rutland wrote: > My x86_64 test case is: > > | unsigned long rdmsr(unsigned long reg) > | { > | unsigned int lo, hi; > | > | asm volatile( >

GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Mark Rutland via Gcc
Hi all, [adding kernel folk who work on asm stuff] As a heads-up, GCC 12 (not yet released) appears to erroneously optimize away calls to functions with volatile asm. Szabolcs has raised an issue on the GCC bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160 ... which is a P1 rele

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-01 Thread Mark Rutland via Gcc
Hi Jeremy, Thanks for raising this. On Fri, Apr 01, 2022 at 11:44:06AM -0500, Jeremy Linton wrote: > The relaxed variants of read/write macros are only declared > as `asm volatile()` which forces the compiler to generate the > instruction in the code path as intended. The only problem > is that i