re PR target/46934 (gcc ICE: error: unrecognizable insn: in extract_insn, at recog...
authorChung-Lin Tang <cltang@codesourcery.com>
Thu, 24 Mar 2011 02:47:55 +0000 (02:47 +0000)
committerChung-Lin Tang <cltang@gcc.gnu.org>
Thu, 24 Mar 2011 02:47:55 +0000 (02:47 +0000)
2011-03-23  Chung-Lin Tang  <cltang@codesourcery.com>

PR target/46934
* config/arm/arm.md (casesi): Use the gen_int_mode() function
to subtract lower bound instead of GEN_INT().

testsuite/
* gcc.target/arm/pr46934.c: New.

From-SVN: r171379

gcc/ChangeLog
gcc/config/arm/arm.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr46934.c [new file with mode: 0644]

index a7bed9093ae3ab7ebb35c8cd79dd6a45707bb048..95de501a87affd3186e69bee6a934fc11d0c96f0 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-23  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       PR target/46934
+       * config/arm/arm.md (casesi): Use the gen_int_mode() function
+       to subtract lower bound instead of GEN_INT().
+
 2011-03-23  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR other/48179
index b0f31f51934e5743da5db0787d703b09de10a883..7a3e4f968cd728cd4804288a59d5ae585ac6c2dc 100644 (file)
        rtx reg = gen_reg_rtx (SImode);
 
        emit_insn (gen_addsi3 (reg, operands[0],
-                              GEN_INT (-INTVAL (operands[1]))));
+                              gen_int_mode (-INTVAL (operands[1]),
+                                            SImode)));
        operands[0] = reg;
       }
 
index cff3e4977bfa3933dd70d99ef4cb50f5b70e0852..3b9eaac3b02ffa4dcb6bee63de283ba29ee6c795 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-23  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       * gcc.target/arm/pr46934.c: New.
+
 2011-03-23  Ian Lance Taylor  <iant@google.com>
 
        * go.test/go-test.exp (errchk): Ignore lines containing ////.
diff --git a/gcc/testsuite/gcc.target/arm/pr46934.c b/gcc/testsuite/gcc.target/arm/pr46934.c
new file mode 100644 (file)
index 0000000..22b8aa8
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv5te -mthumb -Os" }  */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+int caller (unsigned int reg_type)
+{
+  switch (reg_type)
+    {
+    case 0x80000000:
+      return (int)foo();
+
+    case 0x80000003:
+      return (int) bar();
+
+    case 0x80000001:
+      return (int) baz();
+
+    case 0x80000004:
+      return (int) fooz();
+    }
+}