mips.c (mips_va_arg): For EABI...
authorClinton Popetz <cpopetz@cygnus.com>
Tue, 11 Jan 2000 17:42:30 +0000 (17:42 +0000)
committerClinton Popetz <cpopetz@gcc.gnu.org>
Tue, 11 Jan 2000 17:42:30 +0000 (12:42 -0500)
        * 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
gcc/config/mips/mips.c
gcc/config/mips/mips.h

index f728c2e59491e34fb0b4078a530e79e3f1ed5c93..eb6600a610c0d60ef61fad4cd225faea6b53f6bf 100644 (file)
@@ -1,3 +1,14 @@
+2000-01-11  Clinton Popetz  <cpopetz@cygnus.com>
+
+        * 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  <cpopetz@cygnus.com>
 
        * flow.c (propagate_block): When a prologue/epilogue insn
index 63900f25710f76d26443c6afa3700bea0209b92d..67859dff1353d4ec90acb3419dfe3e6a3d072b08 100644 (file)
@@ -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)
index 64212b2d8a1584477230e7719367c725ee658778..1690dfcffc5ab50fca752d12bbd219c3726dca54 100644 (file)
@@ -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);                            \