Commit 7bc22451 by Richard Sandiford Committed by Richard Sandiford

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
parent 35c18a20
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> 2003-08-21 Josef Zlomek <zlomekj@suse.cz>
* fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0 * fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0
......
...@@ -7657,29 +7657,13 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, ...@@ -7657,29 +7657,13 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
nonzero when an argument must be passed by reference. */ nonzero when an argument must be passed by reference. */
int 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, enum machine_mode mode, tree type,
int named ATTRIBUTE_UNUSED) int named ATTRIBUTE_UNUSED)
{ {
int size; int size;
if (mips_abi == ABI_32 || mips_abi == ABI_O64) /* The EABI is the only one to pass args by reference. */
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. */
if (mips_abi != ABI_EABI) if (mips_abi != ABI_EABI)
return 0; return 0;
......
...@@ -2372,18 +2372,13 @@ typedef struct mips_args { ...@@ -2372,18 +2372,13 @@ typedef struct mips_args {
(mips_abi == ABI_EABI && (NAMED) \ (mips_abi == ABI_EABI && (NAMED) \
&& FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, 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) \ #define MUST_PASS_IN_STACK(MODE,TYPE) \
((TYPE) != 0 \ ((TYPE) != 0 \
&& (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
|| TREE_ADDRESSABLE (TYPE) \ || 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)))))
/* True if using EABI and varargs can be passed in floating-point /* True if using EABI and varargs can be passed in floating-point
registers. Under these conditions, we need a more complex form registers. Under these conditions, we need a more complex form
......
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