Skip to content

RISC-V backend does not support PreserveMost calling convention #148147

@CaiWeiran

Description

@CaiWeiran

The RISC-V backend currently does not support the PreserveMost calling convention. Attempting to compile code that uses it results in a fatal error:

fatal error: error in backend: Unsupported calling convention

A minimal example can be seen on Compiler Explorer:
https://godbolt.org/z/h7e5WT7eM

This issue raises a few questions:

  • Should the RISC-V backend implement support for PreserveMost, similar to x86, ARM, and AArch64?
  • Alternatively, should the frontend (or mid-end) automatically lower unsupported calling conventions like PreserveMost to a more compatible one such as C?

It would be helpful to clarify whether support is planned or if users should explicitly avoid using this calling convention on RISC-V targets.

Thanks!

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions