Message ID | 87ppn3fwwy.fsf@canonical.com |
---|---|
State | New |
Headers | show |
Jakub Jelinek <jakub@redhat.com> writes: > On Tue, Feb 11, 2014 at 02:51:08PM +0000, Marcus Shawcroft wrote: >> On 6 February 2014 22:51, Michael Hudson-Doyle >> <michael.hudson@canonical.com> wrote: >> >> > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c >> > index 16c51a8..958c667 100644 >> > --- a/gcc/config/aarch64/aarch64.c >> > +++ b/gcc/config/aarch64/aarch64.c >> > @@ -1187,14 +1187,10 @@ aarch64_pass_by_reference (cumulative_args_t pcum ATTRIBUTE_UNUSED, >> > size = (mode == BLKmode && type) >> > ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); >> > >> > - if (type) >> > + /* Aggregates are passed by reference based on their size. */ >> > + if (type && AGGREGATE_TYPE_P (type)) >> > { >> > - /* Arrays always passed by reference. */ >> > - if (TREE_CODE (type) == ARRAY_TYPE) >> > - return true; >> > - /* Other aggregates based on their size. */ >> > - if (AGGREGATE_TYPE_P (type)) >> > - size = int_size_in_bytes (type); >> > + size = int_size_in_bytes (type); >> > } >> > >> > /* Variable sized arguments are always returned by reference. */ >> >> This version of the patch looks fine. Since this is a bug I think it >> should be committed now in stage 4. This is OK if release manager >> agrees. > > Ok. So, um, can someone commit this please? Cheers, mwh
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.go b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.go new file mode 100644 index 0000000..c795e88 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.go @@ -0,0 +1,10 @@ +package main + +//extern myfunc +func myfunc(e [2]int64) + +func main() { + myfunc([2]int64{40, 50}) +} + + diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.sh b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.sh new file mode 100755 index 0000000..1c41192 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array.sh @@ -0,0 +1,8 @@ +#!/bin/sh +GCCGO=${GCCGO:-gccgo} +AARCH64HOST=${AARCH64HOST:-localhost} + +set -x + +${GCCGO} -g test_array.go abitest.S test_array_c.o -o test_array +scp ./test_array ${AARCH64HOST}: && ssh ${AARCH64HOST} ./test_array diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array_c.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array_c.c new file mode 100644 index 0000000..41066b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_array_c.c @@ -0,0 +1,20 @@ +int which_kind_of_test = 0; + +#include "abitest-common.h" + +void +testfunc (char *stack) +{ + { + long __x = 40; + if (memcmp (&__x, stack + X0, sizeof (long)) != 0) + abort (); + } + { + long __x = 50; + if (memcmp (&__x, stack + X1, sizeof (long)) != 0) + abort (); + } + return; +} +