https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86573

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
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.

Reply via email to