From 7bc224514a62f563e113042440eb8f3a4088aa83 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 21 Aug 2003 11:32:16 +0000 Subject: [PATCH] mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause. * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause. * config/mips/mips.c (function_arg_pass_by_reference): Never return true for n32 & n64. From-SVN: r70641 --- gcc/ChangeLog | 6 ++++++ gcc/config/mips/mips.c | 20 ++------------------ gcc/config/mips/mips.h | 13 ++++--------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44d5e33d063..0537af7b419 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-08-21 Richard Sandiford + + * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause. + * config/mips/mips.c (function_arg_pass_by_reference): Never return + true for n32 & n64. + 2003-08-21 Josef Zlomek * fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 29de990f14e..719c6c89806 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -7657,29 +7657,13 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, nonzero when an argument must be passed by reference. */ int -function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum, +function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, enum machine_mode mode, tree type, int named ATTRIBUTE_UNUSED) { int size; - if (mips_abi == ABI_32 || mips_abi == ABI_O64) - return 0; - - /* We must pass by reference if we would be both passing in registers - and the stack. This is because any subsequent partial arg would be - handled incorrectly in this case. - - ??? This is really a kludge. We should either fix GCC so that such - a situation causes an abort and then do something in the MIPS port - to prevent it, or add code to function.c to properly handle the case. */ - /* ??? cum can be NULL when called from mips_va_arg. The problem handled - here hopefully is not relevant to mips_va_arg. */ - if (cum && MUST_PASS_IN_STACK (mode, type) - && FUNCTION_ARG (*cum, mode, type, named) != 0) - return 1; - - /* Otherwise, we only do this if EABI is selected. */ + /* The EABI is the only one to pass args by reference. */ if (mips_abi != ABI_EABI) return 0; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index edf5583c819..27a4a03eeb4 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2372,18 +2372,13 @@ typedef struct mips_args { (mips_abi == ABI_EABI && (NAMED) \ && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)) -/* Modified version of the macro in expr.h. */ +/* Modified version of the macro in expr.h. Only return true if + the type has a variable size or if the front end requires it + to be passed by reference. */ #define MUST_PASS_IN_STACK(MODE,TYPE) \ ((TYPE) != 0 \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE) \ - || ((MODE) == BLKmode \ - && mips_abi != ABI_32 && mips_abi != ABI_O64 \ - && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ - && 0 == (int_size_in_bytes (TYPE) \ - % (PARM_BOUNDARY / BITS_PER_UNIT))) \ - && (FUNCTION_ARG_PADDING (MODE, TYPE) \ - == (BYTES_BIG_ENDIAN ? upward : downward))))) + || TREE_ADDRESSABLE (TYPE))) /* True if using EABI and varargs can be passed in floating-point registers. Under these conditions, we need a more complex form