This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Optimize incoming function arguments passed in multiple locations
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Subject: Re: Optimize incoming function arguments passed in multiple locations
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 18 Dec 2000 07:40:43 -0200
- Organization: GCC Team, Red Hat
- References: <orbsugyq16.fsf@guarana.lsd.ic.unicamp.br>
On Dec 13, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
> from Alexandre Oliva <aoliva@redhat.com>
> * function.c (assign_parms): Optimize incoming PARALLELs into
> REGs if possible.
> Index: gcc/function.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/function.c,v
> retrieving revision 1.233
> diff -u -p -r1.233 function.c
> --- gcc/function.c 2000/11/30 06:31:17 1.233
> +++ gcc/function.c 2000/12/13 21:19:59
> @@ -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
I've just noticed that at least DWARF2 debugging info generator isn't
prepared to handle PARALLELs in the DECL_INCOMING_RTL of a PARM_DECL.
In general, this shouldn't be necessary because, so far, all cases
that needed PARALLELs had declared_type != passed_type.
Unfortunately, that's not the case of the ABI I'm working on.
I simple fix was to copy entry_parm to DECL_INCOMING_RTL again (it had
been copied a couple of lines before), when modifying entry_parm. Is
this additional change ok to install? (Currently testing with the new
port; success so far)
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me