From 1e7a71c15355d9e092bd76ec5eb4317a114587f5 Mon Sep 17 00:00:00 2001 From: Clinton Popetz Date: Tue, 11 Jan 2000 17:42:30 +0000 Subject: [PATCH] mips.c (mips_va_arg): For EABI... * config/mips/mips.c (mips_va_arg): For EABI, emit the queued integer vararg POSTINCREMENT before the destination of the jump for the hard fp case. (function_arg_pass_by_reference): Pass a copy of CUM to FUNCTION_ARG. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Move check for CONSTANT_ADDRESS_P above while loop for subreg. From-SVN: r31328 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/mips/mips.c | 16 +++++++++++++--- gcc/config/mips/mips.h | 12 +++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f728c2e5949..eb6600a610c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2000-01-11 Clinton Popetz + + * config/mips/mips.c (mips_va_arg): For EABI, emit the queued + integer vararg POSTINCREMENT before the destination of the jump + for the hard fp case. + (function_arg_pass_by_reference): Pass a copy of CUM to + FUNCTION_ARG. + + * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Move check + for CONSTANT_ADDRESS_P above while loop for subreg. + 2000-01-11 Clinton Popetz * flow.c (propagate_block): When a prologue/epilogue insn diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 63900f25710..67859dff135 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4226,6 +4226,9 @@ mips_va_arg (valist, type) if (r != addr_rtx) emit_move_insn (addr_rtx, r); + /* Ensure that the above POSTINCREMENT is emitted before lab_over */ + emit_queue(); + if (lab_over) emit_label (lab_over); @@ -7449,9 +7452,16 @@ function_arg_pass_by_reference (cum, mode, type, named) 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 && FUNCTION_ARG (*cum, mode, type, named) != 0 - && MUST_PASS_IN_STACK (mode, type)) - return 1; + if (cum && MUST_PASS_IN_STACK (mode, type)) + { + /* Don't pass the actual CUM to FUNCTION_ARG, because we would + get double copies of any offsets generated for small structs + passed in registers. */ + CUMULATIVE_ARGS temp = *cum; + if (FUNCTION_ARG (temp, mode, type, named) != 0) + return 1; + } + /* Otherwise, we only do this if EABI is selected. */ if (mips_abi != ABI_EABI) diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 64212b2d8a1..1690dfcffc5 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2804,6 +2804,13 @@ typedef struct mips_args { GO_DEBUG_RTX (xinsn); \ } \ \ + /* Check for constant before stripping off SUBREG, so that we don't \ + accept (subreg (const_int)) which will fail to reload. */ \ + if (CONSTANT_ADDRESS_P (xinsn) \ + && ! (mips_split_addresses && mips_check_split (xinsn, MODE)) \ + && (! TARGET_MIPS16 || mips16_constant (xinsn, MODE, 1, 0))) \ + goto ADDR; \ + \ while (GET_CODE (xinsn) == SUBREG) \ xinsn = SUBREG_REG (xinsn); \ \ @@ -2812,11 +2819,6 @@ typedef struct mips_args { if (GET_CODE (xinsn) == REG && REG_MODE_OK_FOR_BASE_P (xinsn, MODE)) \ goto ADDR; \ \ - if (CONSTANT_ADDRESS_P (xinsn) \ - && ! (mips_split_addresses && mips_check_split (xinsn, MODE)) \ - && (! TARGET_MIPS16 || mips16_constant (xinsn, MODE, 1, 0))) \ - goto ADDR; \ - \ if (GET_CODE (xinsn) == LO_SUM && mips_split_addresses) \ { \ register rtx xlow0 = XEXP (xinsn, 0); \ -- 2.30.2