Commit 2a17357
Clarify address of struct return value is not required to be returned
The psABI didn't specify whether the address should be returned or not.
GCC and LLVM are implemented differently here; GCC will return the
address in a0, but LLVM won't due to it not being specified.
It's a potential ABI incompatible change for GCC, but fortunately GCC
doesn't rely on that behavior and will rematerialise the address rather
than using the value of a0.
The following code can demonstrate this issue:
```
struct int4 {
int values[4];
};
struct int4 i4a;
struct int4 foo (struct int4 arg1)
{
asm volatile ("li a0, 100 #force clobber a0":::"a0");
return arg1;
}
```
Fixes #238
Co-authored-by: Jessica Clarke <[email protected]>1 parent 4969a01 commit 2a17357
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| |||
0 commit comments