Skip to content

core::arch::riscv64::frrm emits an F-extension instruction without #[target_feature(enable = "f")] #165723

Open

Description

@nazar-pc

I tried this code:

#![no_std]
#![feature(riscv_ext_intrinsics)]
pub fn rm() -> u32 { core::arch::riscv64::frrm() }
cargo +nightly build -Zbuild-std=core --target riscv64imac-unknown-none-elf

The same error appears without any user call when core is built with -Clink-dead-code:

RUSTFLAGS=-Clink-dead-code -Zbuild-std=core,alloc --target riscv64imac-unknown-none-elf

I expected to see this happen: this is ordinary safe Rust function and available unconditionally, so it is expected to compile successfully.

Instead, this happened:

error: instruction requires the following: 'F' (Single-Precision Floating-Point) or 'Zfinx' (Float in Integer)
   --> library/core/src/../../stdarch/crates/core_arch/src/riscv_shared/mod.rs:727:14
    |
727 |             "frrm {}",
    |              ^^^^^^^
note: instantiated into assembly here
   --> <inline asm>:1:2
  1 |     frrm a0

Probably should be #[target_feature(enable = "f")] (and then unsafe or target-feature-1.1 safe).

Meta

rustc --version --verbose:

rustc 1.102.0-nightly (5b7b37aef 2026-11-08)
binary: rustc
commit-hash: 5b7b37aefcb5b2fba3c2392bc9065b9e4602d494
commit-date: 2026-11-08
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.5

Activity

  1. added
    C-bug
    on Nov 9, 2026
  2. added
    needs-triage
    on Nov 9, 2026
  3. workingjubilee commented on Nov 10, 2026

    @workingjubilee
    Member
  4. workingjubilee commented on Nov 10, 2026

    @workingjubilee
    Member

    To be clear, the intrinsics and features would be separate stabilizations and I don't think the intrinsics have been proposed for stabilization, merely noting because of the obvious relationship they have.

  5. added
    O-riscv
    T-libs
    A-target-feature
    -Zbuild-std
    and removed
    needs-triage
    on Nov 10, 2026
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

    -Zbuild-stdA-target-featureC-bugO-riscvT-libs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions