https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122913
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Sam James from comment #3) > IMO it should be a P1 until evaluated more, even if it gets downgraded later. I think it should be re-evaluated. The problem is definitely not fixable for GCC 16. And the leela_r mis-optimization has been fixed already. (In reply to Richard Biener from comment #5) >Are there possibly new "patterns" with C++20 we've not yet seen and thus fail to optimize? With C++20, things become constexpr (more); e.g. std::string is almost all constexpr so it gets instantiated now. With C++17 they don't have as std::string is declared with `extern template`. So without the `extern template` you get similar behavior between C++17 and the behavior now in C++20. I noticed gnu_inline was added to the std::exception methods (r16-6547-gf8c32184b85ce7). Maybe it needs to be added to std::string too; I don't know.
