aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-08-21 11:32:16 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-08-21 11:32:16 +0000
commit7bc224514a62f563e113042440eb8f3a4088aa83 (patch)
treebae7fd9f78c20806d0862bb45495c865cbac95a2
parent35c18a2035bc75f7b5dc68f5385986426b5308eb (diff)
downloadgcc-7bc224514a62f563e113042440eb8f3a4088aa83.zip
gcc-7bc224514a62f563e113042440eb8f3a4088aa83.tar.gz
gcc-7bc224514a62f563e113042440eb8f3a4088aa83.tar.bz2
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/mips.c20
-rw-r--r--gcc/config/mips/mips.h13
3 files changed, 12 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 44d5e33..0537af7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-21 Richard Sandiford <rsandifo@redhat.com>
+
+ * 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 <zlomekj@suse.cz>
* 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 29de990..719c6c8 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 edf5583..27a4a03 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