https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105469
--- Comment #2 from RĂ©mi Coulom <remi.coulom at gmail dot com> --- (In reply to Richard Biener from comment #1) > I can reproduce what you observe with -O3 -fwhole-program > -fsanitize=unreachable > (without the sanitize it gets into an infinite loop). -fno-ipa-cp-clone > avoids > the issue (whatever it is exactly). > > Can you attach un-preprocessed source as well? You seem to be not using any > non-standard header files. Thanks for checking my code. The code is available on github: https://github.com/Remi-Coulom/joedb Necessary files to replicate the bug can be found there: https://github.com/Remi-Coulom/joedb/tree/master/doc/source/tutorial/gcc_bug repro.cpp and all_includes.h should be enough. I produced repro.cpp by preprocessing bug.cpp and pruning a lot of code. I suppose repro.cpp should be enough for your purpose. If you ever wish to compile bug.cpp you'll have to compile joedb first by running "./generate.sh" in doc/source/tutorial.