Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal compiler error: librustc_codegen_llvm/mir/operand.rs:165: not immediate #51431

Closed
ojii opened this issue Jun 8, 2018 · 2 comments · Fixed by #65688
Closed

internal compiler error: librustc_codegen_llvm/mir/operand.rs:165: not immediate #51431

ojii opened this issue Jun 8, 2018 · 2 comments · Fixed by #65688
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ojii
Copy link

ojii commented Jun 8, 2018

Running the following code triggers an internal compiler error and the error message says that it's a bug and I should report it, so I'm doing that now: https://play.rust-lang.org/?gist=d30fc571aba5a2b7276cee44445f2a5e&version=nightly&mode=debug

@hellow554
Copy link
Contributor

hellow554 commented Jun 8, 2018

mcve:

#![feature(asm)]

fn main() {
    unsafe {
        asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)}
    }
}

@frewsxcv frewsxcv added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Jun 8, 2018
@hellow554
Copy link
Contributor

hellow554 commented Mar 15, 2019

Note, that this does not ICE anymore on nightly, instead it gives me:

Compiling playground v0.0.1 (/playground)
error[E0669]: invalid value for constraint in inline assembly
  --> src/main.rs:15:11
   |
15 |     apm!(("al", 0x01), ("bx", 0x00));
   |           ^^^^

error[E0669]: invalid value for constraint in inline assembly
  --> src/main.rs:15:25
   |
15 |     apm!(("al", 0x01), ("bx", 0x00));
   |                         ^^^^

error: <inline asm>:1:11: error: unexpected token in argument list
        mov ah,53h
                 ^

  --> src/main.rs:5:13
   |
5  |             asm! {"mov ah,53h"};
   |             ^^^^^^^^^^^^^^^^^^^^
...
15 |     apm!(("al", 0x01), ("bx", 0x00));
   |     --------------------------------- in this macro invocation

error: <inline asm>:1:8: error: unexpected token in argument list
        int 15h
              ^

  --> src/main.rs:9:13
   |
9  |             asm! {"int 15h"};
   |             ^^^^^^^^^^^^^^^^^
...
15 |     apm!(("al", 0x01), ("bx", 0x00));
   |     --------------------------------- in this macro invocation

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0669`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Can this be closed @frewsxcv?

@jonas-schievink jonas-schievink added A-inline-assembly Area: Inline assembly (`asm!(…)`) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Aug 6, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 22, 2019
Add some tests for fixed ICEs

Fixes rust-lang#41366 from 1.35.0
Fixes rust-lang#51431 from 1.31.0-nightly (77af314 2018-10-11) (on my local)
Fixes rust-lang#52437 from nightly
Fixes rust-lang#63496 from nightly

r? @Centril
@bors bors closed this as completed in c3e5413 Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants