Skip to content

arm: no warning when requested ABI cannot be realized due to missing target features #121387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RalfJung opened this issue Dec 31, 2024 · 5 comments
Labels
ABI Application Binary Interface backend:ARM

Comments

@RalfJung
Copy link
Contributor

On RISCV, when I build code with llc -mtriple=riscv32 -mattr=-f -target-abi=ilp32f, I get a nice warning letting me know that this is a nonsensical combination:

Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension (ignoring target-abi)

However, when I do something equivalent on ARM, such as -mtriple=armv8 -float-abi=hard -mattr=-fpregs, then sadly there is no warning. Instead, LLVM silently ignores -float-abi and passes float arguments via the rX registers -- easily leading to a lot of head-scratching and confusion down the road when functions don't have the ABI that one might expect.

@EugeneZelenko EugeneZelenko added backend:AArch64 ABI Application Binary Interface and removed new issue labels Dec 31, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 31, 2024

@llvm/issue-subscribers-backend-aarch64

Author: Ralf Jung (RalfJung)

On RISCV, when I build code with `llc -mtriple=riscv32 -mattr=-f -target-abi=ilp32f`, I [get a nice warning](https://llvm.godbolt.org/z/W5hvMra96) letting me know that this is a nonsensical combination: ``` Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension (ignoring target-abi) ``` However, when I do something equivalent on ARM, such as `-mtriple=armv8 -float-abi=hard -mattr=-fpregs`, then sadly [there is no warning](https://llvm.godbolt.org/z/xaETffao7). Instead, LLVM silently ignores `-float-abi` and passes float arguments via the `rX` registers -- easily leading to a lot of head-scratching and confusion down the road when functions don't have the ABI that one might expect.

@RalfJung
Copy link
Contributor Author

RalfJung commented Dec 31, 2024 via email

@llvmbot
Copy link
Member

llvmbot commented Dec 31, 2024

@llvm/issue-subscribers-backend-arm

Author: Ralf Jung (RalfJung)

On RISCV, when I build code with `llc -mtriple=riscv32 -mattr=-f -target-abi=ilp32f`, I [get a nice warning](https://llvm.godbolt.org/z/W5hvMra96) letting me know that this is a nonsensical combination: ``` Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension (ignoring target-abi) ``` However, when I do something equivalent on ARM, such as `-mtriple=armv8 -float-abi=hard -mattr=-fpregs`, then sadly [there is no warning](https://llvm.godbolt.org/z/xaETffao7). Instead, LLVM silently ignores `-float-abi` and passes float arguments via the `rX` registers -- easily leading to a lot of head-scratching and confusion down the road when functions don't have the ABI that one might expect.

@RalfJung
Copy link
Contributor Author

RalfJung commented Jan 1, 2025

Ah, this is probably a duplicate of #110383, I just forgot that that already existed.

@RalfJung
Copy link
Contributor Author

RalfJung commented Feb 4, 2025

Closing as duplicate of #110383

@RalfJung RalfJung closed this as completed Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Application Binary Interface backend:ARM
Projects
None yet
Development

No branches or pull requests

4 participants