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);
, wherebuilder
is aFunctionBuilder
- cast 1 to
B1
usinglet val = builder.ins().icmp_imm(condcodes::IntCC::NotEqual, val, 0);
- negate the
B1
usinglet val = builder.ins().bnot(val);
- extend the
B1
toI32
usingbuilder.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_cranelift
extends the bool to an I32, do I need to do that?
Last updated: Nov 22 2024 at 16:03 UTC