Hi Michael,
Thanks for the fix. The patch looks OK to me in general, although I
have some minor comments below.
On 01/17/14 08:22, Michael Hudson-Doyle wrote:
Hi, as discussed inhttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=59799
GCC currently gets a detail of the AArch64 ABI wrong: arrays are not
always passed by reference. Fortunately the fix is rather easy...
Can you please indicate what kind of testing you have run, e.g. regtest
on aarch64-none-abi?
Also can you please try to add some new test(s)? It may not be that
straightforward to add non-C/C++ tests, but give it a try.
I guess this is an ABI break but my understand there has been no release
of GCC which supports compiling a language that can pass arrays by value
on AArch64 yet.
Cheers,
mwh
2014-01-17 Michael Hudson-Doyle<michael.hud...@linaro.org>
PR target/59799
* config/aarch64/aarch64.c (aarch64_pass_by_reference):
The rules for passing arrays in registers are the same as
for structs, so remove the special case for them.
aarch64-abi-fix.diff
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index fa53c71..d63da95 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -987,10 +987,7 @@ aarch64_pass_by_reference (cumulative_args_t pcum
ATTRIBUTE_UNUSED,
if (type)
{
- /* Arrays always passed by reference. */
- if (TREE_CODE (type) == ARRAY_TYPE)
- return true;
- /* Other aggregates based on their size. */
+ /* Aggregates based on their size. */
if (AGGREGATE_TYPE_P (type))
size = int_size_in_bytes (type);
}
You can actually merge the two iffs to have something like:
/* Aggregates are based on their size. */
if (type && AGGREGATE_TYPE_P (type))
size = int_size_in_bytes (type);
Thanks,
Yufeng