Skip to content

inline asm opt-level 3 where function incorrectly marked as dead_code #19619

Closed
@mark3982

Description

@mark3982
#![feature(asm)]

fn main() {
    unsafe {
        asm!("call foobar");
    }
}

#[no_mangle]
fn foobar() {

}

The symbol and function foobar are dropped on highest optimization level, because I assume that rustc does not detect that it is referenced.

I believe that it could make sense for it to determine that it is indeed referenced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions