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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
At -O2 we get:

size: 26-3, last_iteration: 2-2
  Loop size: 26
  Estimated size after unrolling: 245
Not unrolling loop 1: size would grow.

With -O3:

size: 20-4, last_iteration: 2-2
  Loop size: 20
  Estimated size after unrolling: 170
/app/example.cpp:8:29: optimized: loop with 16 iterations completely unrolled
(header execution count 63136016)
Exit condition of peeled iterations was eliminated.
Last iteration exit edge was proved true.
Forced exit to be taken: if (0 != 0)



Well yes -O3 is known to cause issues like this. I had thought it was
documented saying that sometimes -O3 might cause performance issues over -O2
but I can't find that documentation either.

Reply via email to