[Bug target/95722] libatomic crashes on __atomic_load of const object

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95722

Andrew Pinski  changed:

   What|Removed |Added

 CC||doodspav at gmail dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 101439 has been marked as a duplicate of this bug. ***

[Bug target/95722] libatomic crashes on __atomic_load of const object

2020-06-17 Thread foom at fuhm dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95722

James Y Knight  changed:

   What|Removed |Added

 CC||foom at fuhm dot net

--- Comment #1 from James Y Knight  ---
The fix would be to have libatomic use a lock instead of the lock-free
cmpxchg16b instruction to implement atomic_load. But I think this is impossible
without causing incompatibility with older GCCs.

Older versions of GCC (before GCC 7), and Clang to this day, emitted cmpxchg16b
inline for a 16-byte atomic load when you compile with -mcx16.

And thus, unfortunately, I think if libatomic switched to a lock now, it would
not be compatible with those older programs.