[Bug tree-optimization/104480] [12 Regression] Combining stores across memory locations might violate [intro.memory]/3

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 10 08:49:00 GMT 2022


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> I don't think [intro.memory]/3 

https://eel.is/c++draft/intro.memory


The only thing this mentions is:
Two or more threads of execution can access separate memory locations without
interfering with each other.


So that means you can access S2.a1 and S2.a2 on two seperate threads
seperately. It also means you cannot depend on the sequence if you write S2.a1
and S2.a2 either and reading it in the same order from the other thread. Unless
you have a memory barrier.

So I think this is invalid too.


More information about the Gcc-bugs mailing list