https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #5 from Gavin Howard <gavin at yzena dot com> --- As mentioned, it works at -O0, and UBSan reports nothing until the segfault. ASan also reports nothing. Valgrind also reports nothing. They all report nothing at -O0 and -O2. I keep my code clean of such things during development, which is one reason I am so confused. I'll get the amalgamation to you, but it will take me some hours to do so.