Skip to content

Segmentation fault compiling inline assembly using function address #70596

Closed
@backup-isaac

Description

@backup-isaac

Code

This was compiled targeting ARM Cortex-A53 with opt-level=3.

#![feature(asm)]
extern "C" fn foo() {}

fn main() {
  unsafe {
    asm!("mov x0, $0"
      :: "r"(foo)
      :: "volatile");
  }
}

Meta

rustc --version --verbose:

rustc 1.37.0-nightly (0af8e872e 2019-06-30)
binary: rustc
commit-hash: 0af8e872ea5ac77effa59f8d3f8794f12cb8865c
commit-date: 2019-06-30
host: x86_64-unknown-linux-gnu
release: 1.37.0-nightly
LLVM version: 8.0

Error output

Segmentation fault (core dumped)
Backtrace

Even re-running the command I invoked previously with RUST_BACKTRACE=1, the only output I get is

Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions