https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70723
--- Comment #4 from Andrew Pinski ---
With -std=c++17 (which is the default now), the code is optimized as expected.
With -std=c++14, the dynamic initializer comes into play; there are a few other
bugs dealing with that already too.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70723
--- Comment #3 from Marc Glisse ---
(In reply to Richard Biener from comment #1)
> There is no pass in GCC that would try to turn the runtime initialization
> into static init again (optimizing the runtime initializers and parsing
> them back to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70723
--- Comment #2 from m.cencora at gmail dot com ---
If that's the case then it should get automatically resolved once C++17 is
implemented - C++17 introduces constexpr lambdas.
But it would be great to have this optimization also in C++14 mode.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70723
Richard Biener changed:
What|Removed |Added
Keywords||missed-optimization
Status|