-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
arch-x8632-bit x8632-bit x86backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.
Milestone
Description
Zig Version
0.12.0-dev.1643+91329ce94
Steps to Reproduce and Observed Behavior
var x: u8 = 0;
export fn f() void {
const addr = @intFromPtr(&x);
g(addr & 0xff == 0);
}
fn g(_: bool) void {}$ zig build-obj repro.zig -target x86-linux-gnu -lc
LLVM Emit Object... zig: /home/mlugg/llvm-project-17/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:284: llvm::Register llvm::InstrEmitter::getVR(llvm::SDValue, llvm::DenseMap<llvm::SDValue, llvm::Register>&): Assertion `I != VRBaseMap.end() && "Node emitted out of order - late"' failed.
AbortedExpected Behavior
It should not crash :)
This reproduction requires linking glibc despite not using any libc symbols.
The issue does not reproduce when attempting to compile the output of --verbose-llvm-ir with llc.
Metadata
Metadata
Assignees
Labels
arch-x8632-bit x8632-bit x86backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.