https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122913
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-02-06
Ever confirmed|0 |1
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.
But:
> ~/install/gcc-16/usr/local/bin/g++ -S t.C -std=c++20 -Ofast -fno-checking -E
> -dD | grep _GLIBCXX_EXTERN_TEMPLATE
#define _GLIBCXX_EXTERN_TEMPLATE 1
> ~/install/gcc-16/usr/local/bin/g++ -S t.C -std=c++17 -Ofast -fno-checking -E
> -dD | grep _GLIBCXX_EXTERN_TEMPLATE
#define _GLIBCXX_EXTERN_TEMPLATE 1
so not sure what comment#2 wants to tell us?
C++20:
text data bss dec hex filename
796421 0 0 796421 c2705 t.o
vs. C++17:
text data bss dec hex filename
571556 0 0 571556 8b8a4 t.o
so there's also 72% more code generated.
-fopt-info differs a lot, the only thing I can say that C++20 optimizes a lot
less, 16894 "optimized" vs. 21277 "optimized" using C++17. I see substantial
less inlining happening.
> nm t.o.C++20 | wc -l
267
> nm t.o.C++17 | wc -l
264
Are there possibly new "patterns" with C++20 we've not yet seen and thus
fail to optimize?