New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#pragma GCC unroll 0
not allowed: invalid value '0'; must be positive
#88624
Comments
@llvm/issue-subscribers-clang-frontend Author: None (MonsterDruide1)
`#pragma GCC unroll 0` does not compile, as apparently the specified number needs to be positive.
However, from <https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html>: The program also successfully compiles with GCC, only Godbolt: https://godbolt.org/z/bEPo64GsP |
Additional info from discussion on Discord:
|
If we look at c724a83 where this change was implemented it looks like the behavior did not change. |
I've a PR to fix this issue #88666 . |
…roll` and `#pragma unroll` (#88666) Fixes #88624 GCC allows the value of loop unroll count to be zero, and the values of 0 and 1 block any unrolling of the loop. This PR aims to make clang keeps the same behavior with GCC. https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html --------- Signed-off-by: yronglin <yronglin777@gmail.com>
Great, thanks for handling it @yronglin ! |
…roll` and `#pragma unroll` (llvm#88666) Fixes llvm#88624 GCC allows the value of loop unroll count to be zero, and the values of 0 and 1 block any unrolling of the loop. This PR aims to make clang keeps the same behavior with GCC. https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html --------- Signed-off-by: yronglin <yronglin777@gmail.com> Change-Id: I7974f28337c270c8239f0e24ea16c09bc3c21c80
#pragma GCC unroll 0
does not compile, as apparently the specified number needs to be positive.However, from https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html:
The program also successfully compiles with GCC, only
clang
seems to have this implemented incorrectly.Godbolt: https://godbolt.org/z/bEPo64GsP
The text was updated successfully, but these errors were encountered: