https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90967
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- Try -std=c++2a? The difference is whether the string functions are extern templates (usual) or not (experimental support for future standards). I would consider it a DUP of all the PRs that show the bad effects of those extern templates on optimization. I still don't know what the best solution(s) would be: - never use extern templates - use LTO in the library - don't drop extern template bodies so aggressively in the compiler.