aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-10-05 13:48:07 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-10-05 13:48:07 -0700
commit518e5ce827c8c11174503f024d401aaec006784b (patch)
tree1560ce4a2466cd50a83e2443470823b12b76a665 /gcc/config
parentb206a75783f8f5a05bb90cad311592c7b717e97c (diff)
downloadgcc-518e5ce827c8c11174503f024d401aaec006784b.zip
gcc-518e5ce827c8c11174503f024d401aaec006784b.tar.gz
gcc-518e5ce827c8c11174503f024d401aaec006784b.tar.bz2
(mips_expand_prologue): Handle structure return values as
the first argument if necessary. From-SVN: r5619
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/mips/mips.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index c97e76b..4763cc1 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -4313,6 +4313,18 @@ mips_expand_prologue ()
tree cur_arg;
CUMULATIVE_ARGS args_so_far;
+ /* If struct value address is treated as the first argument, make it so. */
+ if (aggregate_value_p (DECL_RESULT (fndecl))
+ && ! current_function_returns_pcc_struct
+ && struct_value_incoming_rtx == 0)
+ {
+ tree type = build_pointer_type (fntype);
+ tree function_result_decl = build_decl (PARM_DECL, NULL_TREE, type);
+ DECL_ARG_TYPE (function_result_decl) = type;
+ TREE_CHAIN (function_result_decl) = fnargs;
+ fnargs = function_result_decl;
+ }
+
/* Determine the last argument, and get its name. */
INIT_CUMULATIVE_ARGS (args_so_far, fntype, (rtx)0);