emit-rtl.c (set_reg_attrs_for_parm): New function.

* emit-rtl.c (set_reg_attrs_for_parm): New function.
	* rtl.h (set_reg_attrs_for_parm): New exported function.
	* function.c (assign_parms): Use set_reg_attrs_for_parm instead of
	set_reg_attrs_from_mem.

From-SVN: r63548
This commit is contained in:
Josef Zlomek 2003-02-28 08:06:34 +01:00 committed by Josef Zlomek
parent 486f4cd1b2
commit 9d18e06bd5
4 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2003-02-28 Josef Zlomek <zlomekj@suse.cz>
* emit-rtl.c (set_reg_attrs_for_parm): New function.
* rtl.h (set_reg_attrs_for_parm): New exported function.
* function.c (assign_parms): Use set_reg_attrs_for_parm instead of
set_reg_attrs_from_mem.
2003-02-27 Roger Sayle <roger@eyesopen.com>
Zack Weinberg <zack@codesourcery.com>

View File

@ -1,6 +1,6 @@
/* Emit RTL for the GNU C-Compiler expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -931,6 +931,32 @@ set_reg_attrs_from_mem (reg, mem)
= get_reg_attrs (MEM_EXPR (mem), INTVAL (MEM_OFFSET (mem)));
}
/* Set the register attributes for registers contained in PARM_RTX.
Use needed values from memory attributes of MEM. */
void
set_reg_attrs_for_parm (parm_rtx, mem)
rtx parm_rtx;
rtx mem;
{
if (GET_CODE (parm_rtx) == REG)
set_reg_attrs_from_mem (parm_rtx, mem);
else if (GET_CODE (parm_rtx) == PARALLEL)
{
/* Check for a NULL entry in the first slot, used to indicate that the
parameter goes both on the stack and in registers. */
int i = XEXP (XVECEXP (parm_rtx, 0, 0), 0) ? 0 : 1;
for (; i < XVECLEN (parm_rtx, 0); i++)
{
rtx x = XVECEXP (parm_rtx, 0, i);
if (GET_CODE (XEXP (x, 0)) == REG)
REG_ATTRS (XEXP (x, 0))
= get_reg_attrs (MEM_EXPR (mem),
INTVAL (XEXP (x, 1)));
}
}
}
/* Assign the RTX X to declaration T. */
void
set_decl_rtl (t, x)

View File

@ -4460,7 +4460,7 @@ assign_parms (fndecl)
/* Set also REG_ATTRS if parameter was passed in a register. */
if (entry_parm)
set_reg_attrs_from_mem (entry_parm, stack_parm);
set_reg_attrs_for_parm (entry_parm, stack_parm);
}
/* If this parameter was passed both in registers and in the stack,

View File

@ -1378,6 +1378,7 @@ extern rtx gen_int_mode PARAMS ((HOST_WIDE_INT,
extern rtx emit_copy_of_insn_after PARAMS ((rtx, rtx));
extern void set_reg_attrs_from_mem PARAMS ((rtx, rtx));
extern void set_mem_attrs_from_reg PARAMS ((rtx, rtx));
extern void set_reg_attrs_for_parm PARAMS ((rtx, rtx));
/* In rtl.c */
extern rtx rtx_alloc PARAMS ((RTX_CODE));