[clang] [llvm] [clang][SPARC] Pass 16-aligned 16-byte structs as i128 in CC (PR #155829)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 11:11:16 PDT 2025


beetrees wrote:

Thanks for working on this. This PR correctly fixes the example given in #144709. However, this PR currently fails to correctly pass overaligned structs containing floating point fields. Consider the following example:

```c
struct Struct {
	_Alignas(16) long x;
	double y;
};

double f(long a, struct Struct b) {
	return b.y;
}
```

GCC will correctly pass `b.y` in `d6`, whereas this PR currently incorrectly passes `b.y` in `o3`.

This PR also breaks the ABI of `long double` when in a struct:
```c
struct Struct {
	long double x;
};

long double f(long a, struct Struct b) {
	return b.x;
}
```

GCC and current Clang will pass `b.x` in `q4`, whereas this PR currently incorrectly passes `b.x` in `o2` and `o3`.

https://github.com/llvm/llvm-project/pull/155829


More information about the llvm-commits mailing list