mips.c (mips_function_value): For o32, o64, n32 and n64, use FPRs for scalar, complex...
authorRichard Sandiford <rsandifo@redhat.com>
Wed, 22 Sep 2004 07:27:51 +0000 (07:27 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 22 Sep 2004 07:27:51 +0000 (07:27 +0000)
* config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64,
use FPRs for scalar, complex and vector types only.

From-SVN: r87848

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

index 0902a1dff3ba39d4f61f6e1d2f14c7d3316fa05a..dce40399ab2732f4d14ea48a6287530300b34ef8 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-22  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64,
+       use FPRs for scalar, complex and vector types only.
+
 2004-09-21 Jeff Law  <law@redhat.com>
 
        * tree-ssa-dom.c (opt_stats): Move so that it lives just after
index c564f4e7f186e8ef072f2a980ec4ec179fa75d8b..a1de622dbbf65c544c26f4e0a29e51ce3246d270 100644 (file)
@@ -6764,6 +6764,13 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
              mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
            }
        }
+
+      /* For EABI, the class of return register depends entirely on MODE.
+        For example, "struct { some_type x; }" and "union { some_type x; }"
+        are returned in the same way as a bare "some_type" would be.
+        Other ABIs only use FPRs for scalar, complex or vector types.  */
+      if (mips_abi != ABI_EABI && !FLOAT_TYPE_P (valtype))
+       return gen_rtx_REG (mode, GP_RETURN);
     }
 
   if ((GET_MODE_CLASS (mode) == MODE_FLOAT