Post

Replies

Boosts

Views

Activity

XCode 26.6 Apple LLVM 21.0 bug in O1
#include <stdio.h> void test50() { unsigned int b = 0x7d40d133; unsigned int m = 0x22e5bbf; unsigned int r = 64; b += (((m) << ((int)(r))) | ((m) >> (32 - (int)(r)))); // expect b = 0x7f6f2cf2, however in opt bigger than O1, b = 0x819d88b1 printf("%#x\n", b); } int main() { test50(); return 0; } Compiling with -O0 and -O1 produces different results. There appears to be a compiler optimization bug that is triggered when r % 32 == 0,This feature works correctly in Xcode 26.0.
1
0
348
2d
XCode 26.6 Apple LLVM 21.0 bug in O1
#include <stdio.h> void test50() { unsigned int b = 0x7d40d133; unsigned int m = 0x22e5bbf; unsigned int r = 64; b += (((m) << ((int)(r))) | ((m) >> (32 - (int)(r)))); // expect b = 0x7f6f2cf2, however in opt bigger than O1, b = 0x819d88b1 printf("%#x\n", b); } int main() { test50(); return 0; } Compiling with -O0 and -O1 produces different results. There appears to be a compiler optimization bug that is triggered when r % 32 == 0,This feature works correctly in Xcode 26.0.
Replies
1
Boosts
0
Views
348
Activity
2d