[Bug target/55690] On some targets thread_fence is not a compiler barrier when memmodel != MEMMODEL_SEQ_CST

schuchart at icl dot utk.edu gcc-bugzilla@gcc.gnu.org
Mon Mar 14 21:16:59 GMT 2022


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

--- Comment #2 from Joseph <schuchart at icl dot utk.edu> ---
Created attachment 52626
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52626&action=edit
Reproducer

I created a reproducer (see attached file or online:
https://godbolt.org/z/n76K3Ejds). 

Note that the acquire fence does not prevent GCC 7 from loading l->b ahead of
the loop. With GCC 8 and later l->b is loaded inside the loop (as it should
be).


More information about the Gcc-bugs mailing list