Skip to content

#[target_feature(..)] no longer in effect in naked functions #136280

@tmiasko

Description

@tmiasko

Since #128004, target features enabled with #[target_feature(..)] are no longer in effect in naked functions. For example:

// --crate-typelib --target aarch64-unknown-linux-gnu
#![feature(naked_functions)]
use std::arch::{asm, naked_asm};

#[target_feature(enable = "aes")]
pub unsafe extern "C" fn f() {
    // ok
    asm!("aese.16b v0, v1");
}

#[target_feature(enable = "aes")]
#[naked]
pub unsafe extern "C" fn g() {
    // Before #128004: ok
    // After  #128004: error: instruction requires: aes
    naked_asm!("aese.16b v0, v1");
}

I haven't seen this discussed in the pull request. Opening the issue to give a chance to review the behaviour before stabilization.

cc @folkertdev, @Amanieu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)A-nakedArea: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSC-bugCategory: This is a bug.F-naked_functions`#![feature(naked_functions)]`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions