Skip to content

Tracking Issue for -Zregparm #131749

Open
Open
@azhogin

Description

@azhogin

This is a tracking issue for the -Zregparm flag for x86. It is the equivalent of Clang's/GCC's -mregparm=3. The kernel needs it to support the x86 32-bit architecture, together with -Zreg-struct-return.

It could potentially be a "global target feature", i.e. a target feature that is required to be set the same way for all compilation units.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions & Answers

  • Q: Should it affect the Rust ABI? It cannot be documented as doing such, because the Rust ABI is unstable, but should it do so anyways as a quality-of-implementation matter?
    • Currently: No.
    • Alternatives:
      • Maybe yes?
      • Maybe we want to have a modification equivalent to "fastcall" or -Zregparm=3 apply to the Rust ABI implicitly, without -Zregparm affecting it?
  • Q: Should it affect any other ABIs than "C", "cdecl", and "stdcall"?
    • Currently: No.
    • Alternatives: It's not yet clear what ABIs this affects for gcc and clang.
  • Q: Should it be accepted on any other architecture than x86_32?
    • Currently: No.
  • Q: Does MSVC code use this? extern "fastcall" does something equivalent to -Zregparm=2, so do MSVC targets even use it, or do they just use fastcall?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)A-CLIArea: Command-line interface (CLI) to the compilerA-rust-for-linuxRelevant for the Rust-for-Linux projectC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCO-x86_32Target: x86 processors, 32 bit (like i686-*) (IA-32)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions