From e68a6ce10ead591f90742ada0f513a66977fe889 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 13 Dec 2000 21:24:03 +0000 Subject: function.c (assign_parms): Optimize incoming PARALLELs into REGs if possible. * function.c (assign_parms): Optimize incoming PARALLELs into REGs if possible. From-SVN: r38233 --- gcc/function.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index 5e01c65..0799216 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4549,6 +4549,26 @@ assign_parms (fndecl) && nominal_mode != BLKmode && nominal_mode != passed_mode) stack_parm = 0; + /* When an argument is passed in multiple locations, we can't + make use of this information, but we can save some copying if + the whole argument is passed in a single register. */ + if (GET_CODE (entry_parm) == PARALLEL + && nominal_mode != BLKmode && passed_mode != BLKmode) + { + int i, len = XVECLEN (entry_parm, 0); + + for (i = 0; i < len; i++) + if (XEXP (XVECEXP (entry_parm, 0, i), 0) != NULL_RTX + && GET_CODE (XEXP (XVECEXP (entry_parm, 0, i), 0)) == REG + && (GET_MODE (XEXP (XVECEXP (entry_parm, 0, i), 0)) + == passed_mode) + && XINT (XEXP (XVECEXP (entry_parm, 0, i), 1), 0) == 0) + { + entry_parm = XEXP (XVECEXP (entry_parm, 0, i), 0); + break; + } + } + /* ENTRY_PARM is an RTX for the parameter as it arrives, in the mode in which it arrives. STACK_PARM is an RTX for a stack slot where the parameter can live -- cgit v1.1