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

ICE -Zsave-analysis + asm : issue-72570.rs #72960

Closed
matthiaskrgr opened this issue Jun 3, 2020 · 3 comments · Fixed by #73019
Closed

ICE -Zsave-analysis + asm : issue-72570.rs #72960

matthiaskrgr opened this issue Jun 3, 2020 · 3 comments · Fixed by #73019
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. F-asm `#![feature(asm)]` (not `llvm_asm`) 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

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jun 3, 2020

Code

code from ./src/test/ui/asm/issue-72570.rs

// only-x86_64

#![feature(asm)]

fn main() {
    unsafe {
        asm!("", in("invalid") "".len());
        //~^ ERROR: invalid register `invalid`: unknown register
    }
}

Meta

repo is @ 6f48888

Error output

build/x86_64-unknown-linux-gnu/stage2/bin/rustc ./src/test/ui/asm/issue-72570.rs -Zsave-analysis

error: invalid register `invalid`: unknown register
 --> ./src/test/ui/asm/issue-72570.rs:7:18
  |
7 |         asm!("", in("invalid") "".len());
  |                  ^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: src/librustc_middle/hir/map/mod.rs:813: expected expr, found unknown node (hir_id=HirId { owner: DefId(0:3 ~ issue_72570[317d]::main[0]), local_id: 3 })

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

error: aborting due to 2 previous errors
Backtrace

error: invalid register `invalid`: unknown register
 --> ./src/test/ui/asm/issue-72570.rs:7:18
  |
7 |         asm!("", in("invalid") "".len());
  |                  ^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: src/librustc_middle/hir/map/mod.rs:813: expected expr, found unknown node (hir_id=HirId { owner: DefId(0:3 ~ issue_72570[317d]::main[0]), local_id: 3 })

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
stack backtrace:
   0:     0x7fed9c18ce07 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6129db55f2395b00
   1:     0x7fed9c1d999d - core::fmt::write::h65255e7874586eb2
   2:     0x7fed9c15db95 - std::io::Write::write_fmt::hbf3ccd0f0d2c8616
   3:     0x7fed9c169980 - std::panicking::default_hook::{{closure}}::h74fe3c93ec09b89c
   4:     0x7fed9c169694 - std::panicking::default_hook::h18ec94680373bfcc
   5:     0x7fed9db3bd63 - rustc_driver::report_ice::h4fc186d9ba1d4385
   6:     0x7fed9c16a06c - std::panicking::rust_panic_with_hook::hb1014dbead89930a
   7:     0x7feda1c53ec3 - std::panicking::begin_panic::hc7ac9df6d5f04237
   8:     0x7feda1c62a90 - rustc_errors::HandlerInner::bug::h3a5c08e2bff213a1
   9:     0x7feda1c61360 - rustc_errors::Handler::bug::h2de8785b7d405dfe
  10:     0x7feda17f8dd6 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h07ececa769a009a5
  11:     0x7feda17f0a75 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h797739bc970a6b0d
  12:     0x7feda17f09dd - rustc_middle::ty::context::tls::with_opt::h7d9bc9ed25b40901
  13:     0x7feda17f8ce5 - rustc_middle::util::bug::opt_span_bug_fmt::hb60567835bc1d4bb
  14:     0x7feda17f8c50 - rustc_middle::util::bug::bug_fmt::h8d9a01560db8d487
  15:     0x7feda154acbd - rustc_middle::hir::map::Map::expect_expr::h1884cfecf0a6cf3f
  16:     0x7fed9dbf03ca - rustc_save_analysis::SaveContext::get_expr_data::h5996a1f915bb9a02
  17:     0x7fed9dc41494 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_ast::visit::Visitor>::visit_expr::h1d1c0690082940d0
  18:     0x7fed9dc2fc76 - rustc_ast::visit::walk_expr::hbc84fe4c38361139
  19:     0x7fed9dc3000f - rustc_ast::visit::walk_expr::hbc84fe4c38361139
  20:     0x7fed9dc3f28f - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_ast::visit::Visitor>::visit_item::h1220efd921fe2694
  21:     0x7fed9dc39baa - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_ast::visit::Visitor>::visit_mod::h28097d46ffb1455c
  22:     0x7fed9db2dbe3 - rustc_ast::visit::walk_crate::h56adcbbb6aef269c
  23:     0x7fed9dafc94b - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h95d462bcd954e806
  24:     0x7fed9db9d430 - rustc_session::utils::<impl rustc_session::session::Session>::time::hc2362ef3dbb9abab
  25:     0x7fed9db0da49 - rustc_middle::ty::context::tls::enter_global::h1ea40c7f1f137d3b
  26:     0x7fed9db0ffeb - rustc_interface::interface::run_compiler_in_existing_thread_pool::he10d9dfcb60e9bff
  27:     0x7fed9db4d6d0 - rustc_ast::attr::with_globals::h1df959b8a9a2dc54
  28:     0x7fed9db4f408 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1fd3c02dac5c3d0e
  29:     0x7fed9daff22e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h17f6d80818e9b275
  30:     0x7fed9c171d7a - std::sys::unix::thread::Thread::new::thread_start::h00452227f2552ee2
  31:     0x7fed9be98422 - start_thread
  32:     0x7fed9bfb6bf3 - __GI___clone
  33:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to 2 previous errors

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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. labels Jun 3, 2020
@jonas-schievink jonas-schievink added A-inline-assembly Area: Inline assembly (`asm!(…)`) A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. F-asm `#![feature(asm)]` (not `llvm_asm`) labels Jun 3, 2020
@Xanewok
Copy link
Member

Xanewok commented Jun 4, 2020

Does this still happen with (now merged) #72882?

@marmeladema
Copy link
Contributor

I can confirm its fixed. We can probably close this issue.

@Xanewok
Copy link
Member

Xanewok commented Jun 5, 2020

Closing this, thanks for taking a look!

@Xanewok Xanewok closed this as completed Jun 5, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 5, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 5, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 5, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#72260 (Spell out `Self` in async function return)
 - rust-lang#72996 (Remove unsused `NodeId` related APIs in hir map)
 - rust-lang#73010 (Update RELEASES.md)
 - rust-lang#73017 (Use assert_eq for liballoc test)
 - rust-lang#73019 (add test for rust-lang#72960)

Failed merges:

r? @ghost
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-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. F-asm `#![feature(asm)]` (not `llvm_asm`) 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