https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109996
mcccs at gmx dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mcccs at gmx dot com --- Comment #5 from mcccs at gmx dot com --- Created attachment 61396 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61396&action=edit adapted for trunk and older GCCs and Clang, removed warnings Here's the a little bit hand-simplified version (I mostly removed redundant attributes and header lines) that works in earlier GCCs, LLVM, latest trunk. LLVM's sanitizers don't find a problem. It fails with O2 or O3 since 7.1. I can't bisect because I only have aarch64 vm on mac and they haven't responded to my cfarm account request yet, so someone else has to do the bisection since the trunk of earlier than 2018 can't be built on aarch64. If you open a text editor and replace the single occurence of __attribute__((used)) with nothing, which is the single use of the attribute "used" in my cleaned up version, the segmentation fault is gone.