(function_arg): Add explicit checks for FIELD_DECLs.
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 8 Jul 1996 21:55:32 +0000 (14:55 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 8 Jul 1996 21:55:32 +0000 (14:55 -0700)
(mips_function_value): Add explicit checks for FIELD_DECLs, and save
them in the array FIELDS.  When returning structure with 1 float field,
enclose it in a PARALLEL and set the PARALLEL mode correctly.
* mips/mips.md (call_value): Call gen_call_value_multiple_internal0
only if there are multiple return values.  Strip the PARALLEL off
if there there is only one return value.

From-SVN: r12411

gcc/config/mips/mips.md

index 06d57cc0459d56500fbbb20f1a34fd750c9d5983..fc8caca07d8f1f3e178982b170d0de61996002a4 100644 (file)
@@ -6496,7 +6496,7 @@ move\\t%0,%z4\\n\\
 
       /* Handle Irix6 function calls that have multiple non-contiguous
         results.  */
-      if (GET_CODE (operands[0]) == PARALLEL)
+      if (GET_CODE (operands[0]) == PARALLEL && XVECLEN (operands[0], 0) > 1)
        {
          emit_call_insn (gen_call_value_multiple_internal0
                          (XEXP (XVECEXP (operands[0], 0, 0), 0),
@@ -6506,6 +6506,11 @@ move\\t%0,%z4\\n\\
          DONE;
        }
 
+      /* We have a call returning a DImode structure in an FP reg.
+        Strip off the now unnecessary PARALLEL.  */
+      if (GET_CODE (operands[0]) == PARALLEL)
+       operands[0] = XEXP (XVECEXP (operands[0], 0, 0), 0);
+
       emit_call_insn (gen_call_value_internal0 (operands[0], operands[1], operands[2],
                                                gen_rtx (REG, SImode, GP_REG_FIRST + 31)));