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

2022-04-01 Thread Jeremy Linton via Gcc
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 it doesn't also tell the compiler that there may be memory side effects. Meaning that if a function is compris

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 Jeremy Linton via Gcc
Hi, On 4/11/22 05:31, Mark Rutland 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 functions with volatile asm. Szabolcs has raised a