[Bug tree-optimization/118544] -fopt-info misreports unroll factor when using #pragma GCC unroll

tiborgyri at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jan 18 21:57:04 GMT 2025


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

--- Comment #3 from Tibor Győri <tiborgyri at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> The unroll 2 is correct, it was unrolled one time; likewise 3 is unrolled
> twice, etc. I suspect you are missunderstanding what the diagnostic is
> saying, it is saying unrolled the loop one extra iteration.
OK, I guess that does make sense, but it is unexpected that it does not follow
the same "counting convention" as the pragma. In the pragma one requests an
unroll factor, while the opt-info messages say how many iterations are
unrolled.

For what its worth, clang reports the unroll factor in its opt-info messages,
which feels like the more natural choice of "counting convention" to me.


More information about the Gcc-bugs mailing list