diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-08-20 08:53:47 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-08-20 08:53:47 +0000 |
commit | b12cdd6e8e8dd1f39a941b731ba1056d656a094f (patch) | |
tree | d93dca858cd33ec6231aff799254ba6497ff9089 /gcc/function.c | |
parent | 0ffef2005fd7536efbc9c3a572701998c8a8080c (diff) | |
download | gcc-b12cdd6e8e8dd1f39a941b731ba1056d656a094f.zip gcc-b12cdd6e8e8dd1f39a941b731ba1056d656a094f.tar.gz gcc-b12cdd6e8e8dd1f39a941b731ba1056d656a094f.tar.bz2 |
Add a apply_pass_by_reference_rules helper
This patch adds a helper routine that applies pass-by-reference
semantics to an existing function_arg_info.
The c6x part means that c6x_function_arg and c6x_function_arg_advance
see the same "named" value as pass_by_reference did, rather than
pass_by_reference seeing "true" and the others seeing "false".
This doesn't matter because the c6x port doesn't care about namedness.
The rs6000.c patch removes an assignment to "type", but the only
later code to use it was the patched promote_mode line.
(The reason for patching these places despite the above is that
often target code gets used as a basis for new targets or changes
to existing ones.)
2019-08-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* calls.h (apply_pass_by_reference_rules): Declare.
* calls.c (apply_pass_by_reference_rules): New function.
* config/c6x/c6x.c (c6x_call_saved_register_used): Use it.
* config/rs6000/rs6000-call.c (rs6000_parm_needs_stack): Likewise.
* config/s390/s390.c (s390_call_saved_register_used): Likewise.
* function.c (assign_parm_find_data_types): Likewise.
* var-tracking.c (prepare_call_arguments): Likewise.
From-SVN: r274704
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c index 46ed75c..265bcd1 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2456,11 +2456,11 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, /* See if this arg was passed by invisible reference. */ { function_arg_info arg (passed_type, passed_mode, data->named_arg); - if (pass_by_reference (&all->args_so_far_v, arg)) + if (apply_pass_by_reference_rules (&all->args_so_far_v, arg)) { - passed_type = nominal_type = build_pointer_type (passed_type); + passed_type = nominal_type = arg.type; data->passed_pointer = true; - passed_mode = nominal_mode = TYPE_MODE (nominal_type); + passed_mode = nominal_mode = arg.mode; } } |