Closed
Description
Hello,
It looks like in some cases (ie. not enough optimizations turned on), enum members cannot be used as 'i' operands for inline assembly:
#![feature(asm)]
#[repr(usize)]
enum Foo {
Bar = 1,
}
fn main() {
unsafe {
asm!("" :: "i" (9isize), "i" (Foo::Bar));
}
}
http://play.integer32.com/?gist=befc6872b583ffaa1609f081b7536b50&version=nightly
Given this is (with macros, maybe?) the only use I can think of 'i' operands, I think it is reasonable to say the 'i' operand is currently broken.
This would be solved by even the slightest level of constant folding, so I think even in debug mode it should actually constant fold to something that builds, and not have successful compilation be dependent of the specific compiler version and flags used (as is currently the case).