From 16beb09945584104912af9274e2e3bb03a6ea05d Mon Sep 17 00:00:00 2001 From: rth Date: Tue, 16 Nov 1999 17:43:40 +0000 Subject: [PATCH] * explow.c (hard_function_value): Add outgoing argument. * expr.h (hard_function_value): Declare it. * calls.c (expand_call, emit_library_call_value): Update callers. * function.c (aggregate_value_p): Ditto. (diddle_return_value): Must look at the outgoing registers on archs with register windows. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30550 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 35 ++++++++++++++++++++++------------- gcc/calls.c | 6 +++--- gcc/explow.c | 16 +++++++++++++--- gcc/expr.h | 2 +- gcc/function.c | 4 ++-- 5 files changed, 41 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b137d7a..b03966b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +1999-11-16 Jakub Jelinek + + * explow.c (hard_function_value): Add outgoing argument. + * expr.h (hard_function_value): Declare it. + * calls.c (expand_call, emit_library_call_value): Update callers. + * function.c (aggregate_value_p): Ditto. + (diddle_return_value): Must look at the outgoing registers + on archs with register windows. + Mon Nov 15 20:46:45 1999 Richard Henderson * alpha.c (alpha_build_va_list): Use make_lang_type and @@ -35,7 +44,7 @@ Mon Nov 15 15:33:18 1999 Richard Henderson Based on proposed addition from David Edelsohn. 1999-11-15 Robert Lipe - Bruce Korb + Bruce Korb * fixinc/inclhack.def (AAB_svr4_replace_byteorder): added. Takes advantage of GCC features @@ -150,7 +159,7 @@ Fri Nov 12 08:54:22 1999 Mark Mitchell Fri Nov 12 08:04:45 1999 Catherine Moore * defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Use - ASM_OUTPUT_LABEL. + ASM_OUTPUT_LABEL. Fri Nov 12 13:31:54 1999 Bernd Schmidt @@ -222,15 +231,15 @@ Wed Nov 10 15:56:16 1999 Jeffrey A Law (law@cygnus.com) worklists. Fix boundary cases. Compute maximal solutions. (compute_laterin, compute_nearerout): Similarly. - * dwarf2out.c (add_AT_location_description): Allow - (mem (plus (pseudo) (...)) too. + * dwarf2out.c (add_AT_location_description): Allow + (mem (plus (pseudo) (...)) too. Wed Nov 10 10:52:42 1999 Tom Tromey * gcc.c (do_spec_1): Support text between `%u' and `%O'. Wed Nov 10 12:43:21 1999 Philippe De Muyter - Kaveh R. Ghazi + Kaveh R. Ghazi * cppinit.c: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. @@ -279,9 +288,9 @@ Wed Nov 10 04:58:09 1999 Alexandre Oliva Wed Nov 10 00:02:53 1999 Jeffrey A Law (law@cygnus.com) - * flow.c (compute_flow_dominators): No longer treat basic block 0 - or (n_basic_blocks - 1) specially. Clear the AUX field before - starting computation of doms/pdoms. Fix initial state for pdoms. + * flow.c (compute_flow_dominators): No longer treat basic block 0 + or (n_basic_blocks - 1) specially. Clear the AUX field before + starting computation of doms/pdoms. Fix initial state for pdoms. Wed Nov 10 03:58:08 1999 Alexandre Oliva @@ -445,8 +454,8 @@ Sun Nov 7 20:55:14 1999 Mark Mitchell Sun Nov 7 19:41:17 1999 Catherine Moore - * config/elfos.h (ASM_DECLARE_FUNCTION_NAME): Conditionally define. - (ASM_DECLARE_FUNCTION_SIZE): Conditionally define. + * config/elfos.h (ASM_DECLARE_FUNCTION_NAME): Conditionally define. + (ASM_DECLARE_FUNCTION_SIZE): Conditionally define. Sun Nov 7 10:23:28 1999 Mark P. Mitchell @@ -512,9 +521,9 @@ Sat Nov 6 09:52:09 1999 Richard Henderson Sat Nov 6 07:48:59 1999 Catherine Moore - * config/svr4.h (ASM_DECLARE_FUNCTION): Check if already - defined. - (ASM_DECLARE_FUNCTION_SIZE): Likewise. + * config/svr4.h (ASM_DECLARE_FUNCTION): Check if already + defined. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. Fri Nov 5 18:33:39 1999 J"orn Rennecke diff --git a/gcc/calls.c b/gcc/calls.c index 15b64e0e..48c0d5e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2211,9 +2211,9 @@ expand_call (exp, target, ignore) { if (pcc_struct_value) valreg = hard_function_value (build_pointer_type (TREE_TYPE (exp)), - fndecl); + fndecl, 0); else - valreg = hard_function_value (TREE_TYPE (exp), fndecl); + valreg = hard_function_value (TREE_TYPE (exp), fndecl, 0); } /* Precompute all register parameters. It isn't safe to compute anything @@ -3138,7 +3138,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, #ifdef PCC_STATIC_STRUCT_RETURN rtx pointer_reg = hard_function_value (build_pointer_type (type_for_mode (outmode, 0)), - 0); + 0, 0); mem_value = gen_rtx_MEM (outmode, pointer_reg); pcc_struct_value = 1; if (value == 0) diff --git a/gcc/explow.c b/gcc/explow.c index 857bcc6..437c935 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1541,14 +1541,24 @@ probe_stack_range (first, size) in which a scalar value of data type VALTYPE was returned by a function call to function FUNC. FUNC is a FUNCTION_DECL node if the precise function is known, - otherwise 0. */ + otherwise 0. + OUTGOING is 1 if on a machine with register windows this function + should return the register in which the function will put its result + and 0 otherwise. */ rtx -hard_function_value (valtype, func) +hard_function_value (valtype, func, outgoing) tree valtype; tree func ATTRIBUTE_UNUSED; + int outgoing ATTRIBUTE_UNUSED; { - rtx val = FUNCTION_VALUE (valtype, func); + rtx val; +#ifdef FUNCTION_OUTGOING_VALUE + if (outgoing) + val = FUNCTION_OUTGOING_VALUE (valtype, func); + else +#endif + val = FUNCTION_VALUE (valtype, func); if (GET_CODE (val) == REG && GET_MODE (val) == BLKmode) { diff --git a/gcc/expr.h b/gcc/expr.h index 816b86d..e603d04 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -1067,7 +1067,7 @@ extern rtx trampoline_address PROTO((tree)); /* Return an rtx that refers to the value returned by a function in its original home. This becomes invalid if any more code is emitted. */ -extern rtx hard_function_value PROTO((tree, tree)); +extern rtx hard_function_value PROTO((tree, tree, int)); extern rtx prepare_call_address PROTO((rtx, tree, rtx *, int)); diff --git a/gcc/function.c b/gcc/function.c index 000ea2d..7c491df 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3992,7 +3992,7 @@ aggregate_value_p (exp) return 1; /* Make sure we have suitable call-clobbered regs to return the value in; if not, we must return it in memory. */ - reg = hard_function_value (type, 0); + reg = hard_function_value (type, 0, 0); /* If we have something other than a REG (e.g. a PARALLEL), then assume it is OK. */ @@ -6211,7 +6211,7 @@ diddle_return_value (code) /* Use hard_function_value to avoid creating a reference to a BLKmode register in the USE/CLOBBER insn. */ return_reg = hard_function_value (TREE_TYPE (decl_result), - current_function_decl); + current_function_decl, 1); REG_FUNCTION_VALUE_P (return_reg) = 1; emit_insn (gen_rtx_fmt_e (code, VOIDmode, return_reg)); } -- 2.7.4