From aadc1c43157fe7ae3f99b2ebc8aa1cf1850ded73 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 19 Feb 2014 15:32:54 +0000 Subject: [PATCH] re PR target/59799 (aarch64_pass_by_reference never passes arrays by value, contrary to ABI documentation) 2014-02-19 Michael Hudson-Doyle 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. From-SVN: r207908 --- gcc/ChangeLog | 7 +++++++ gcc/config/aarch64/aarch64.c | 10 +++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eca2f7a780bf..5007b7a4593b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-02-19 Michael Hudson-Doyle + + 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. + 2014-02-19 Eric Botcazou * expr.c (expand_expr_real_1) : For a bit-field diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index ea90311ac547..901ad3de793c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1197,14 +1197,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. */ -- 2.47.3