This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Un-promoting incoming arguments passed by reference
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Neil Booth <neil at daikokuya dot demon dot co dot uk>, gcc-patches at gcc dot gnu dot org
- Date: 14 Feb 2002 17:26:59 -0200
- Subject: Re: Un-promoting incoming arguments passed by reference
- Organization: GCC Team, Red Hat
- References: <or8zlyb1vw.fsf@guarana.lsd.ic.unicamp.br><20010322231521.A9991@daikokuya.demon.co.uk><or7l1g4bqa.fsf@guarana.lsd.ic.unicamp.br><ork7tk6s2z.fsf@free.redhat.lsd.ic.unicamp.br><20020212133418.B23328@redhat.com>
On Feb 12, 2002, Richard Henderson <rth@redhat.com> wrote:
> On Mon, Feb 11, 2002 at 11:55:32AM -0200, Alexandre Oliva wrote:
>> * function.c (assign_parms): De-mote promoted argument passed by
>> transparent reference.
> Ok. No hyphen in demote.
Thanks. I fixed this in the comment within the patch too, and checked
this in:
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* function.c (assign_parms): Demote promoted argument passed by
transparent reference.
Index: gcc/function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.345
diff -u -p -r1.345 function.c
--- gcc/function.c 2002/01/23 12:39:16 1.345
+++ gcc/function.c 2002/02/14 19:26:39
@@ -4749,13 +4749,15 @@ assign_parms (fndecl)
/* If we were passed a pointer but the actual value
can safely live in a register, put it in one. */
if (passed_pointer && TYPE_MODE (TREE_TYPE (parm)) != BLKmode
- && ! ((! optimize
- && ! DECL_REGISTER (parm))
- || TREE_SIDE_EFFECTS (parm)
- /* If -ffloat-store specified, don't put explicit
- float variables into registers. */
- || (flag_float_store
- && TREE_CODE (TREE_TYPE (parm)) == REAL_TYPE)))
+ /* If by-reference argument was promoted, demote it. */
+ && (TYPE_MODE (TREE_TYPE (parm)) != GET_MODE (DECL_RTL (parm))
+ || ! ((! optimize
+ && ! DECL_REGISTER (parm))
+ || TREE_SIDE_EFFECTS (parm)
+ /* If -ffloat-store specified, don't put explicit
+ float variables into registers. */
+ || (flag_float_store
+ && TREE_CODE (TREE_TYPE (parm)) == REAL_TYPE))))
{
/* We can't use nominal_mode, because it will have been set to
Pmode above. We must use the actual mode of the parm. */
--
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 Professional serial bug killer