https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128240
--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> --- More to the point, GCC assumes accesses to in bounds of g_t will not cause a fault. This is the only correct approach. If you mark the variable as weak then it will be considered as faulting and should work. Basically all global variables are considered not to fault for reads unless they are weak. All non-const global variables are considered not to fault for writes too. Though writes have one additional thing is that GCC can't do optimizations which violate the C11/C++11 memory models for racy events.
