Skip to content

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

Closed

Description

@matthiaskrgr

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

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 3, 2020
  2. added
    A-inline-assemblyArea: Inline assembly (`asm!(…)`)
    A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.
    F-asm`#![feature(asm)]` (not `llvm_asm`)
    on Jun 3, 2020
  3. Xanewok commented on Jun 4, 2020

    @Xanewok
    Contributor

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

  4. marmeladema commented on Jun 5, 2020

    @marmeladema
    Contributor

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

  5. Xanewok commented on Jun 5, 2020

    @Xanewok
    Contributor

    Closing this, thanks for taking a look!

  6. added a commit that references this issue on Jun 5, 2020
  7. added 2 commits that reference this issue on Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.C-bugCategory: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions