[Bug c++/86590] Codegen regression when passing std::string by value in C++ 17 and C++ 20
s_gccbugzilla at nedprod dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 19 18:17:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86590
--- Comment #1 from Niall Douglas <s_gccbugzilla at nedprod dot com> ---
Quoting from bug 86573 regarding this bug:
> The real difference in -std=c++17 is _GLIBCXX_EXTERN_TEMPLATE. With
> -std=c++14, we have many extern templates which the compiler almost never
> inlines. This leaves existing inline functions small enough to be inlined in
> main (once it is renamed). With -std=c++17, extern templates are gone,
> everything is inlined, and the function that used to be small enough to be
> inlined is now too big (several smaller functions have been inlined into it
> first). Without inlining, the compiler cannot notice all the simplifications.
> (this is in large part guesswork, feel free to verify)
>
> If someone wants to improve it, I would look into the inliner heuristics,
> but that's probably going to be hard.
More information about the Gcc-bugs
mailing list