-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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).
benbrittain
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.