diff options
author | cpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-17 13:27:54 +0000 |
---|---|---|
committer | cpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-17 13:27:54 +0000 |
commit | 5900cfad0da933ce80d845663f26e89d557bbfcc (patch) | |
tree | 70081ed980ee7802e8a7089bbba402c6ed26545d /gcc/config/mips/mips.c | |
parent | e42d7fe1b7de0b44130c6999b54a1f49234d4436 (diff) | |
download | gcc-5900cfad0da933ce80d845663f26e89d557bbfcc.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 8d9c55ead27..e9258ba1e8f 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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)) |