alexcrichton transferred Issue #922:
I'm trying to compile this simple C program:
int main() { return !1; }I'll spare you the parsing, what my program does after implicit casts is:
- create a literal using
let val = builder.ins().iconst(types::I32, 1);, wherebuilderis aFunctionBuilder- cast 1 to
B1usinglet val = builder.ins().icmp_imm(condcodes::IntCC::NotEqual, val, 0);- negate the
B1usinglet val = builder.ins().bnot(val);- extend the
B1toI32usingbuilder.ins().bint(types::I32, val)This gives me a verifier error:
VerifierError { location: inst2, message: "v2 is a real GPR value defined by a ghost instruction" }.What, if anything, am I doing wrong? I see that
rustc_codegen_craneliftextends the bool to an I32, do I need to do that?
Last updated: Dec 06 2025 at 05:03 UTC