Commit 8403445a by Alan Modra Committed by Alan Modra

calls.c (store_one_arg): Revert 1999-02-16 change.

	* calls.c (store_one_arg): Revert 1999-02-16 change.  Revert
	2000-12-17 change.  Pass EXPAND_STACK_PARM to expand_expr.
	* expr.h (enum expand_modifier): Define EXPAND_STACK_PARM.
	(enum block_op_methods): Reorder for better store_expr optimization.
	* expr.c (store_expr): Test bit 1 of "want_value" for call param
	stores, test bit 0 for original want_value meaning.  Pass
	BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set.  Adjust
	recursive calls, and calls to expand_param.
	(expand_expr): Handle EXPAND_STACK_PARM modifier.  When cse
	expected, set target to 0 rather than to subtarget.  Formatting.

From-SVN: r63337
parent ef906381
2003-02-24 Alan Modra <amodra@bigpond.net.au>
* calls.c (store_one_arg): Revert 1999-02-16 change. Revert
2000-12-17 change. Pass EXPAND_STACK_PARM to expand_expr.
* expr.h (enum expand_modifier): Define EXPAND_STACK_PARM.
(enum block_op_methods): Reorder for better store_expr optimization.
* expr.c (store_expr): Test bit 1 of "want_value" for call param
stores, test bit 0 for original want_value meaning. Pass
BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set. Adjust
recursive calls, and calls to expand_param.
(expand_expr): Handle EXPAND_STACK_PARM modifier. When cse
expected, set target to 0 rather than to subtarget. Formatting.
2003-02-23 Kazu Hirata <kazu@cs.umass.edu>
* gcse.c (cprop_jump): Use the REG_EQUAL note if available.
......
......@@ -4341,13 +4341,6 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
}
}
}
/* Now that we have saved any slots that will be overwritten by this
store, mark all slots this store will use. We must do this before
we actually expand the argument since the expansion itself may
trigger library calls which might need to use the same stack slot. */
if (argblock && ! variable_size && arg->stack)
for (i = lower_bound; i < upper_bound; i++)
stack_usage_map[i] = 1;
}
/* If this isn't going to be placed on both the stack and in registers,
......@@ -4400,7 +4393,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
(partial
|| TYPE_MODE (TREE_TYPE (pval)) != arg->mode)
? NULL_RTX : arg->stack,
VOIDmode, 0);
VOIDmode, EXPAND_STACK_PARM);
/* If we are promoting object (or for any other reason) the mode
doesn't agree, convert the mode. */
......@@ -4543,37 +4536,6 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
}
}
/* Special handling is required if part of the parameter lies in the
register parameter area. The argument may be copied into the stack
slot using memcpy(), but the original contents of the register
parameter area will be restored after the memcpy() call.
To ensure that the part that lies in the register parameter area
is copied correctly, we emit a separate push for that part. This
push should be small enough to avoid a call to memcpy(). */
#ifndef STACK_PARMS_IN_REG_PARM_AREA
if (arg->reg && arg->pass_on_stack)
#else
if (1)
#endif
{
if (arg->offset.constant < reg_parm_stack_space && arg->offset.var)
error ("variable offset is passed partially in stack and in reg");
else if (arg->offset.constant < reg_parm_stack_space && arg->size.var)
error ("variable size is passed partially in stack and in reg");
else if (arg->offset.constant < reg_parm_stack_space
&& ((arg->offset.constant + arg->size.constant)
> reg_parm_stack_space))
{
rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant);
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1,
parm_align, partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->alignment_pad));
}
}
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
parm_align, partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
......@@ -4591,6 +4553,12 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
arg->value = arg->stack_slot;
}
/* Mark all slots this store used. */
if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL)
&& argblock && ! variable_size && arg->stack)
for (i = lower_bound; i < upper_bound; i++)
stack_usage_map[i] = 1;
/* Once we have pushed something, pops can't safely
be deferred during the rest of the arguments. */
NO_DEFER_POP;
......
/* Definitions for code generation pass of GNU compiler.
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -44,13 +44,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define QUEUED_NEXT(P) XEXP (P, 4)
/* This is the 4th arg to `expand_expr'.
EXPAND_STACK_PARM means we are possibly expanding a call param onto
the stack. Choosing a value of 2 isn't special; It just allows
some code optimization in store_expr.
EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx.
EXPAND_INITIALIZER is similar but also record any labels on forced_labels.
EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address
is a constant that is not a legitimate address.
EXPAND_WRITE means we are only going to write to the resulting rtx. */
enum expand_modifier {EXPAND_NORMAL, EXPAND_SUM, EXPAND_CONST_ADDRESS,
EXPAND_INITIALIZER, EXPAND_WRITE};
enum expand_modifier {EXPAND_NORMAL = 0, EXPAND_STACK_PARM = 2, EXPAND_SUM,
EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER, EXPAND_WRITE};
/* Prevent the compiler from deferring stack pops. See
inhibit_defer_pop for more information. */
......@@ -378,8 +381,8 @@ extern rtx convert_modes PARAMS ((enum machine_mode, enum machine_mode,
enum block_op_methods
{
BLOCK_OP_NORMAL,
BLOCK_OP_CALL_PARM,
BLOCK_OP_NO_LIBCALL
BLOCK_OP_NO_LIBCALL,
BLOCK_OP_CALL_PARM
};
extern rtx emit_block_move PARAMS ((rtx, rtx, rtx, enum block_op_methods));
......
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