-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[clang] Crash at O2: Assertion `llvm::isUIntN(BitWidth, val) && "Value is not an N-bit unsigned value"' failed. #118934
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
Labels
Comments
I haven't tested this, but maybe something like this
|
@llvm/issue-subscribers-backend-x86 Author: Yunbo Ni (cardigan1008)
This code crashed at O2:
static char c = -2, l;
char d;
int e, f, b, k;
static char *g = &d;
long h;
static int *i = &f;
char a;
int m(int n) {
if (n < 0)
return n;
return 0;
}
void o(long n) { *i = m(c + 6) + c + n; }
void main() {
a = c;
char *j[2] = {&g};
for (; b;)
;
*g = 0;
e |= 0 != h;
l = *g;
o(l != 0);
c = 7;
for (;; c = 0)
k = *i + *i;
} Compiler Explorer: https://godbolt.org/z/r96WqYacv Bisected to 3e1b55c which was committed by @nikic The crash is:
Backtrace:
|
Reduced: define void @PR118934(i1 %b, ptr %f, ptr %k) {
entry:
%0 = select i1 %b, i8 0, i8 -2
br label %for.end
for.end:
%n.i.i = select i1 poison, i32 6, i32 7
%narrow = add nsw i8 %0, -6
%add2.i = sext i8 %narrow to i32
%conv5.i = add nsw i32 %n.i.i, %add2.i
store i32 %conv5.i, ptr %f, align 4
%add = shl nsw i32 %conv5.i, 1
store i32 %add, ptr %k, align 4
unreachable
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code crashed at O2:
Compiler Explorer: https://godbolt.org/z/r96WqYacv
Bisected to 3e1b55c which was committed by @nikic
The crash is:
Backtrace:
The text was updated successfully, but these errors were encountered: