https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87465
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Target Milestone|--- |9.0 Summary|Loop removal regression |[8/9 Regression] Loop | |removal regression --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This changed with r255267, we don't peel/completely unroll the loop nest anymore. I'd say in this case it would be best done by a constexpr-like evaluation pass, where we'd just at compile time try to evaluate a few (hundreds) iterations of the loop at compile time and see if we can simply capture the whole outcome of the loop (final values, maybe some simple array stores). Until then, use C++14 constexpr evaluation if you want stuff to be evaluated at compile time.