Commit 9d18e06b by Josef Zlomek Committed by Josef Zlomek

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
parent 486f4cd1
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>
......
/* 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)
......
......@@ -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,
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment