cfallin commented on issue #1110:
This is an old issue and I believe we have proper support for the above now; feel free to open more issues as needed if there are still holes in bool support!
cfallin closed issue #1110:
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: Dec 23 2024 at 13:07 UTC