llvm / llvm/llvm-project

__ARM_PCS_AAPCS64 is incorrectly defined for aarch64-macos, aarch64-windows/aarch64-mingw and a few other aarch64 targets

Open
#170,262 2 comments 0 reactions 0 assignees View on GitHub
backend:AArch64 clang:frontend
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

According to the ACLE __ARM_PCS_AAPCS64 should only be defined:
```
__ARM_PCS_AAPCS64 is defined to 1 if the default procedure calling standard for the translation unit conforms to the [[AAPCS64]](https://arm-software.github.io/acle/main/acle.html#AAPCS64).
```
But windows/mingw procedure call standard is different from AAPCS64 (e.g. var_args is different).
Mac OS's precedure calling standard is also different (e.g. arguments are zero/sign extended).

I should note I found this while auditing GCC's macros definitions too (and yes GCC incorrectly defines it).

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating the target-specific definitions of __ARM_PCS_AAPCS64 for aarch64-macos, aarch64-windows, and aarch64-mingw, then compare them with the ACLE AAPCS64 requirement and the calling conventions described in the report. Done means the macro is defined only where the default procedure calling standard conforms to AAPCS64.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.