https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602

--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #3)
> I'm still not convinced this is a bug.  For example, all kernel code
> uses `asm volatile ("" ::: "memory")` as barrier to stop GCC to reorder code
> through it, not `asm volatile ("" :::)`.  So the developers have been aware
> a "asm volatile" does NOT mean a barrier. If we change this behaviour and
> stop reordering through all "asm volatile"s, the generated code could be
> slower.

The bug in IRA is that it would move volatile asm statements to wherever
else it felt like, including for example over another volatile asm.  That
is the bug, which my patch fixes.  Making volatile asm a "barrier" (what
does that even _mean_?!) is a bad idea, I certainly agree.

Reply via email to