On Fri, Oct 24, 2025 at 09:45:12PM +0800, H.J. Lu wrote:
> For x86, volatile memory can be used as source operand for loads.  Add
> -fcombine-op-with-volatile-memory-load to allow operations with volatile
> memory load:

A volatile memory access can never ever be combined with any other insn.
A volatile memory access is one with an *unspecified* side effect, by
definition.  Combining something with an unspecified side effect into
something else with an unspecified side effect is just wrong (nowhere
is it given that the two side effects are at all related!)

If you want to have something with a side effect combined, use an
unspec_volatile for that?  There, you *do* say what the side effect is!

So no, this is not okay, and can never be okay.


Segher

Reply via email to