Allow passing arrays in registers on AArch64

Message ID 87ha93nhl1.fsf@canonical.com
State New
Headers show

Commit Message

Michael-Doyle Hudson Jan. 17, 2014, 8:22 a.m.
Hi, as discussed in http://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...

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.hudson@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.

Patch hide | download patch | download mbox

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);
     }