-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmiscompilationregression:19Regression in 19 releaseRegression in 19 release
Description
This code prints random value at -O2/3/s and -1 at -O0/1:
int printf(const char *, ...);
int a, b;
void c(char d) { a = d; }
int e(int d) {
if (d < 0)
return 1;
return 0;
}
int f() {
if (b)
return 0;
return 1;
}
int g(int d) {
int h = 0;
if (3 + d)
h = f() - 1 - 1;
return e(h) + h + h;
}
int main() {
int i = g(0);
c(i);
printf("%d\n", a);
}Compiler Explorer: https://godbolt.org/z/KfWsKxcvE
It starts from x86_64 clang 19.1.0.
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmiscompilationregression:19Regression in 19 releaseRegression in 19 release