Commit 9e5ac782 by Clinton Popetz Committed by Clinton Popetz

mips.c (mips_expand_prologue): Don't calculate the last argument register unless we need it.

	* mips.c (mips_expand_prologue): Don't calculate the last
	argument register unless we need it.  When we are calculating
	this, make sure FUNCTION_ARG is giving us a REG.

From-SVN: r35094
parent 39a6492f
Mon Jul 17 08:26:35 2000 Clinton Popetz <cpopetz@cygnus.com>
* mips.c (mips_expand_prologue): Don't calculate the last
argument register unless we need it. When we are calculating
this, make sure FUNCTION_ARG is giving us a REG.
2000-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* flow.c (libcall_dead_p): Use single_set to verify the insn
......@@ -6,6 +12,7 @@
2000-07-17 Mark Klein <mklein@dis.com>
* pa.c (emit_hpdiv_const): Update to match new pattern for udivsi3.
2000-07-17 J. David Anglin <dave@hiauly1.hia.nrc.ca>
......
......@@ -6942,6 +6942,8 @@ mips_expand_prologue ()
tree cur_arg;
CUMULATIVE_ARGS args_so_far;
rtx reg_18_save = NULL_RTX;
int store_args_on_stack = (mips_abi == ABI_32 || mips_abi == ABI_O64)
&& (! mips_entry || mips_can_use_return_insn ());
/* If struct value address is treated as the first argument, make it so. */
if (aggregate_value_p (DECL_RESULT (fndecl))
......@@ -6960,7 +6962,9 @@ mips_expand_prologue ()
of the first argument in the variable part of the argument list,
otherwise GP_ARG_LAST+1. Note also if the last argument is
the varargs special argument, and treat it as part of the
variable arguments. */
variable arguments.
This is only needed if store_args_on_stack is true. */
INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0);
regno = GP_ARG_FIRST;
......@@ -6982,7 +6986,7 @@ mips_expand_prologue ()
FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1);
next_arg = TREE_CHAIN (cur_arg);
if (entry_parm)
if (entry_parm && store_args_on_stack)
{
if (next_arg == 0
&& DECL_NAME (cur_arg)
......@@ -6997,7 +7001,10 @@ mips_expand_prologue ()
else
{
int words;
if (GET_CODE (entry_parm) != REG)
abort ();
/* passed in a register, so will get homed automatically */
if (GET_MODE (entry_parm) == BLKmode)
words = (int_size_in_bytes (passed_type) + 3) / 4;
......@@ -7042,8 +7049,7 @@ mips_expand_prologue ()
/* If this function is a varargs function, store any registers that
would normally hold arguments ($4 - $7) on the stack. */
if ((mips_abi == ABI_32 || mips_abi == ABI_O64)
&& (! mips_entry || mips_can_use_return_insn ())
if (store_args_on_stack
&& ((TYPE_ARG_TYPES (fntype) != 0
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
!= void_type_node))
......
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