https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94293
--- Comment #2 from Eyal Rozenberg <eyalroz at technion dot ac.il> --- Note: The bugs also manifest with this slightly simpler program: #include <string> int bar() { std::string second { "Hey... no small-string optimization for me please!" }; return 123; } See: https://godbolt.org/z/LjmNYi