[committed] Fix fixed-point ICEs for MIPS16

Richard Sandiford rsandifo@nildram.co.uk
Sun Sep 23 11:25:00 GMT 2007


The new fixed-point support didn't work for MIPS16 because we didn't
know how to force fractional and accumulator values into the constant
pool.  Fortunately, it's just a case of generalising a few tests
(just like Chao-Ying had to do in varasm.c:output_constant_pool_2).

Tested on mipsisa64-elfoabi.  The only MIPS16 fixed-point failures are
those caused by the promotion patch (and there are only two such for
MIPS16, as opposed to three for non-MIPS16).  Applied.

Richard


gcc/
	* config/mips/mips.c (dump_constants_1): Generalize to include
	fractional and accumulator modes.

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	2007-09-23 09:59:32.000000000 +0100
+++ gcc/config/mips/mips.c	2007-09-23 09:59:40.000000000 +0100
@@ -10218,30 +10218,28 @@ add_constant (struct mips16_constant_poo
 static rtx
 dump_constants_1 (enum machine_mode mode, rtx value, rtx insn)
 {
-  switch (GET_MODE_CLASS (mode))
+  if (SCALAR_INT_MODE_P (mode)
+      || ALL_SCALAR_FRACT_MODE_P (mode)
+      || ALL_SCALAR_ACCUM_MODE_P (mode))
     {
-    case MODE_INT:
-      {
-	rtx size = GEN_INT (GET_MODE_SIZE (mode));
-	return emit_insn_after (gen_consttable_int (value, size), insn);
-      }
+      rtx size = GEN_INT (GET_MODE_SIZE (mode));
+      return emit_insn_after (gen_consttable_int (value, size), insn);
+    }
 
-    case MODE_FLOAT:
-      return emit_insn_after (gen_consttable_float (value), insn);
+  if (SCALAR_FLOAT_MODE_P (mode))
+    return emit_insn_after (gen_consttable_float (value), insn);
 
-    case MODE_VECTOR_FLOAT:
-    case MODE_VECTOR_INT:
-      {
-	int i;
-	for (i = 0; i < CONST_VECTOR_NUNITS (value); i++)
-	  insn = dump_constants_1 (GET_MODE_INNER (mode),
-				   CONST_VECTOR_ELT (value, i), insn);
-	return insn;
-      }
+  if (VECTOR_MODE_P (mode))
+    {
+      int i;
 
-    default:
-      gcc_unreachable ();
+      for (i = 0; i < CONST_VECTOR_NUNITS (value); i++)
+	insn = dump_constants_1 (GET_MODE_INNER (mode),
+				 CONST_VECTOR_ELT (value, i), insn);
+      return insn;
     }
+
+  gcc_unreachable ();
 }
 
 



More information about the Gcc-patches mailing list