#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