expr.h (promoted_input_arg): Remove decl.
* expr.h (promoted_input_arg): Remove decl. * function.c (promoted_input_arg): Merge into ... * combine.c (setup_incoming_promotions): ... only caller. Rearrange to avoid double loop. From-SVN: r122479
This commit is contained in:
parent
1769232d26
commit
962f383322
|
@ -1,3 +1,10 @@
|
||||||
|
2007-03-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* expr.h (promoted_input_arg): Remove decl.
|
||||||
|
* function.c (promoted_input_arg): Merge into ...
|
||||||
|
* combine.c (setup_incoming_promotions): ... only caller.
|
||||||
|
Rearrange to avoid double loop.
|
||||||
|
|
||||||
2007-03-02 Ben Elliston <bje@au.ibm.com>
|
2007-03-02 Ben Elliston <bje@au.ibm.com>
|
||||||
Peter Bergner <bergner@vnet.ibm.com>
|
Peter Bergner <bergner@vnet.ibm.com>
|
||||||
Janis Johnson <janis187@us.ibm.com>
|
Janis Johnson <janis187@us.ibm.com>
|
||||||
|
|
|
@ -1014,26 +1014,35 @@ init_reg_last (void)
|
||||||
static void
|
static void
|
||||||
setup_incoming_promotions (void)
|
setup_incoming_promotions (void)
|
||||||
{
|
{
|
||||||
unsigned int regno;
|
rtx first;
|
||||||
rtx reg;
|
tree arg;
|
||||||
enum machine_mode mode;
|
|
||||||
int unsignedp;
|
|
||||||
rtx first = get_insns ();
|
|
||||||
|
|
||||||
if (targetm.calls.promote_function_args (TREE_TYPE (cfun->decl)))
|
if (!targetm.calls.promote_function_args (TREE_TYPE (cfun->decl)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
first = get_insns ();
|
||||||
|
|
||||||
|
for (arg = DECL_ARGUMENTS (current_function_decl); arg;
|
||||||
|
arg = TREE_CHAIN (arg))
|
||||||
{
|
{
|
||||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
rtx reg = DECL_INCOMING_RTL (arg);
|
||||||
/* Check whether this register can hold an incoming pointer
|
|
||||||
argument. FUNCTION_ARG_REGNO_P tests outgoing register
|
if (!REG_P (reg))
|
||||||
numbers, so translate if necessary due to register windows. */
|
continue;
|
||||||
if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (regno))
|
|
||||||
&& (reg = promoted_input_arg (regno, &mode, &unsignedp)) != 0)
|
if (TYPE_MODE (DECL_ARG_TYPE (arg)) == TYPE_MODE (TREE_TYPE (arg)))
|
||||||
{
|
{
|
||||||
record_value_for_reg
|
enum machine_mode mode = TYPE_MODE (TREE_TYPE (arg));
|
||||||
(reg, first, gen_rtx_fmt_e ((unsignedp ? ZERO_EXTEND
|
int uns = TYPE_UNSIGNED (TREE_TYPE (arg));
|
||||||
: SIGN_EXTEND),
|
|
||||||
GET_MODE (reg),
|
mode = promote_mode (TREE_TYPE (arg), mode, &uns, 1);
|
||||||
gen_rtx_CLOBBER (mode, const0_rtx)));
|
if (mode == GET_MODE (reg) && mode != DECL_MODE (arg))
|
||||||
|
{
|
||||||
|
rtx x;
|
||||||
|
x = gen_rtx_CLOBBER (DECL_MODE (arg), const0_rtx);
|
||||||
|
x = gen_rtx_fmt_e ((uns ? ZERO_EXTEND : SIGN_EXTEND), mode, x);
|
||||||
|
record_value_for_reg (reg, first, x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -597,9 +597,6 @@ extern rtx label_rtx (tree);
|
||||||
if how is not obvious). */
|
if how is not obvious). */
|
||||||
extern rtx force_label_rtx (tree);
|
extern rtx force_label_rtx (tree);
|
||||||
|
|
||||||
/* Indicate how an input argument register was promoted. */
|
|
||||||
extern rtx promoted_input_arg (unsigned int, enum machine_mode *, int *);
|
|
||||||
|
|
||||||
/* Return an rtx like arg but sans any constant terms.
|
/* Return an rtx like arg but sans any constant terms.
|
||||||
Returns the original rtx if it has no constant terms.
|
Returns the original rtx if it has no constant terms.
|
||||||
The constant terms are added and stored via a second arg. */
|
The constant terms are added and stored via a second arg. */
|
||||||
|
|
|
@ -3228,40 +3228,6 @@ gimplify_parameters (void)
|
||||||
|
|
||||||
return stmts;
|
return stmts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicate whether REGNO is an incoming argument to the current function
|
|
||||||
that was promoted to a wider mode. If so, return the RTX for the
|
|
||||||
register (to get its mode). PMODE and PUNSIGNEDP are set to the mode
|
|
||||||
that REGNO is promoted from and whether the promotion was signed or
|
|
||||||
unsigned. */
|
|
||||||
|
|
||||||
rtx
|
|
||||||
promoted_input_arg (unsigned int regno, enum machine_mode *pmode, int *punsignedp)
|
|
||||||
{
|
|
||||||
tree arg;
|
|
||||||
|
|
||||||
for (arg = DECL_ARGUMENTS (current_function_decl); arg;
|
|
||||||
arg = TREE_CHAIN (arg))
|
|
||||||
if (REG_P (DECL_INCOMING_RTL (arg))
|
|
||||||
&& REGNO (DECL_INCOMING_RTL (arg)) == regno
|
|
||||||
&& TYPE_MODE (DECL_ARG_TYPE (arg)) == TYPE_MODE (TREE_TYPE (arg)))
|
|
||||||
{
|
|
||||||
enum machine_mode mode = TYPE_MODE (TREE_TYPE (arg));
|
|
||||||
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (arg));
|
|
||||||
|
|
||||||
mode = promote_mode (TREE_TYPE (arg), mode, &unsignedp, 1);
|
|
||||||
if (mode == GET_MODE (DECL_INCOMING_RTL (arg))
|
|
||||||
&& mode != DECL_MODE (arg))
|
|
||||||
{
|
|
||||||
*pmode = DECL_MODE (arg);
|
|
||||||
*punsignedp = unsignedp;
|
|
||||||
return DECL_INCOMING_RTL (arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Compute the size and offset from the start of the stacked arguments for a
|
/* Compute the size and offset from the start of the stacked arguments for a
|
||||||
parm passed in mode PASSED_MODE and with type TYPE.
|
parm passed in mode PASSED_MODE and with type TYPE.
|
||||||
|
|
Loading…
Reference in New Issue