https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119154
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I really hate these hidden options/tweaks, it is complete nightmare for bug reporting. In any case, confirmed, bits/std.cc needs to be compiled with -O3 -D_FORTIFY_SOURCE (or =2 or =3), the #c0 main.cpp can be compiled without (well, better it should be because _FORTIFY_SOURCE is not supported at -O0).