-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-hardware-interruptsArea: Code for handling the "interrupt ABI" of various processorsArea: Code for handling the "interrupt ABI" of various processorsC-bugCategory: This is a bug.Category: This is a bug.O-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)O-riscvTarget: RISC-V architectureTarget: RISC-V architectureT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code with rustc --target riscv64gc-unknown-linux-gnu rust_code.rs
:
#![feature(abi_riscv_interrupt)]
pub extern "riscv-interrupt-m" fn interrupt_machine() {}
pub extern "riscv-interrupt-s" fn interrupt_supervisor() {}
pub fn main() {
interrupt_machine();
interrupt_supervisor();
}
I expected to see this happen: rustc or LLVM reject the direct call.
Instead, this happened:
...wait, why does it compile? This doesn't seem like it should compile...
Meta
rustc --version --verbose
:
rustc 1.84.0-nightly (a0d98ff0e 2024-10-31)
binary: rustc
commit-hash: a0d98ff0e5b6e1f2c63fd26f68484792621b235c
commit-date: 2024-10-31
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.
@rustbot label: +A-hardware-interrupts +A-LLVM +O-riscv +A-ABI +T-compiler
Related Issues
9names
Metadata
Metadata
Assignees
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-hardware-interruptsArea: Code for handling the "interrupt ABI" of various processorsArea: Code for handling the "interrupt ABI" of various processorsC-bugCategory: This is a bug.Category: This is a bug.O-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)O-riscvTarget: RISC-V architectureTarget: RISC-V architectureT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.