[Bug libgcc/107675] [13 Regression] GCC-13 is significantly slower to startup on C++ statically linked programs
tneumann at users dot sourceforge.net
gcc-bugzilla@gcc.gnu.org
Fri Dec 9 22:46:49 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107675
--- Comment #15 from Thomas Neumann <tneumann at users dot sourceforge.net> ---
> You cannot use 'relaxed' atomic load in is_object_initialized - as thread
> performing such load will not observe/synchronize with any modifications
> (other than atomic variable itself) performed by other threads.
you are right, this has to be acquire. Very unfortunate. I thought we would get
away with relaxed because we double-check anyway, but with relaxed we might
miss the writes to the other fields of object.
On systems with strong memory order it does not matter, but on ARM this will
make the check slower.
More information about the Gcc-bugs
mailing list