Skip to content

Rust's i128 return ABI does not agree with Clang and GCC on Windows targets #134288

Closed

Description

@tgross35

Originally reported at rust-lang/lang-team#255 (comment), Clang and GCC-MinGW return __int128 in xmm0. Rust currently returns it on the stack.

@wesleywiser has a proposed patch to make Clang return on the stack for -msvc targets, while keeping the behavior for MinGW wesleywiser/llvm-project@b2f8b83.

Rustc could probably just change the Windows ABI to always return in xmm0 for now, and then if the Clang patch lands we can change this to apply only to MinGW.

Demo: https://godbolt.org/z/o9h8We69o

Activity

  1. added
    A-ABIArea: Concerning the application binary interface (ABI)
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    C-bugCategory: This is a bug.
    O-windowsOperating system: Windows
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Dec 13, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Dec 13, 2024
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Dec 13, 2024
  4. added a commit that references this issue on Dec 14, 2024
  5. added a commit that references this issue on Dec 15, 2024
  6. 28 remaining items

  7. added a commit that references this issue on Jun 4, 2025
  8. added a commit that references this issue on Jun 4, 2025
  9. added 2 commits that reference this issue on Jun 17, 2025
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

    A-ABIArea: Concerning the application binary interface (ABI)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.O-windowsOperating system: WindowsT-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