You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[LoongArch] wrong code: select between a _BitInt(16) value and a sign-extended _BitInt(8) value is sign-extended from bit 7 #241868
Activity
llvmorg-github-actions commentedon Nov 12, 2026
@llvm/issue-subscribers-backend-loongarch
Author: Takuya Shizuka (hazohelet)
Details
Live Reproducer: https://godbolt.org/z/TEfWGMefzCompiling the following C code for
loongarch64withclang -O1and running it prints the wrong result.clang command:
Output (wrong):
Expected (what -O0 prints, and what x86-64 prints):
uis 128, so the condition is false andrshould bea, which is 128. The generated code instead sign-extends the selected value from bit 7:Notes:
clang version: