]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause.
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2003 11:32:16 +0000 (11:32 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2003 11:32:16 +0000 (11:32 +0000)
* config/mips/mips.c (function_arg_pass_by_reference): Never return
true for n32 & n64.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70641 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/config/mips/mips.h

index 44d5e33d06348e867e2f25f7b4946847bae2a0ae..0537af7b419fd39faceba2a018986b5d6a4a594c 100644 (file)
@@ -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
index 29de990f14e1e97c264789ae1efa10607f63be91..719c6c89806b72e068a0cbcbe5351eb9b945d03f 100644 (file)
@@ -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;
 
index edf5583c819fb665f51a11763e42b5017e35a761..27a4a03eeb4707fffaba32d5f4ae03b11923e41f 100644 (file)
@@ -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