-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
arch-aarch6464-bit Arm64-bit ArmbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.upstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.
Milestone
Description
Here's the reduced llvm-ir test case:
; Function Attrs: cold nobuiltin noreturn nounwind
define internal void @bar() unnamed_addr #1 {
unreachable
}
define i1 @foo(i1) unnamed_addr #0 {
Entry:
switch i1 %0, label %BadValue [
i1 false, label %OkValue
i1 true, label %OkValue
]
BadValue:
call fastcc void @bar()
unreachable
OkValue:
ret i1 %0
} LLVM9 generates nonsensical code:
mov w8, #1
mov w9, w0
and w9, w9, w8
mov w10, #0
and w8, w10, w8 // w8 is turned into zero
cmp w9, w8 // Comparison against zero
str w0, [sp, #12]
b.ls .LBB1_2 // The branch is _never_ takenPlease report to the LLVM devs, I have no bugzilla account.
Metadata
Metadata
Assignees
Labels
arch-aarch6464-bit Arm64-bit ArmbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.upstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.