-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Closed as not planned
Labels
floating-pointFloating-point mathFloating-point mathmiscompilationquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
This code prints 83619472 at -O0/1 and 83619480 at -O2/3:
int printf(const char *, ...);
int a, b;
int main() {
int c = 7;
float d = 0;
while (c) {
d++;
c /= 2;
a = 384 + 1;
}
float e = a + 2;
b = d + 1.442695f * (e * e * e);
printf("%d\n", b);
}Compiler Explorer: https://godbolt.org/z/f5bf9os1P
Metadata
Metadata
Assignees
Labels
floating-pointFloating-point mathFloating-point mathmiscompilationquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!