re PR target/51106 (ICE in move_insn, at haifa-sched.c:2314)
authorAndrey Belevantsev <abel@gcc.gnu.org>
Fri, 20 Jan 2012 06:22:24 +0000 (10:22 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Fri, 20 Jan 2012 06:22:24 +0000 (10:22 +0400)
gcc:/
2012-01-20  Andrey Belevantsev  <abel@ispras.ru>

      PR target/51106
      * function.c (instantiate_virtual_regs_in_insn): Use
      delete_insn_and_edges when removing a wrong asm insn.

testsuite:/
2012-01-20  Jakub Jelinek  <jakub@redhat.com>

      PR target/51106
      * gcc.dg/torture/pr51106-1.c: New test.
      * gcc.dg/torture/pr51106-2.c: New test.

From-SVN: r183325

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr51106-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr51106-2.c [new file with mode: 0644]

index 1266cd52df299c94abfaec08760e6081dd807adc..b05a76494297a12d407bca9cf065e47fe2902c29 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-20  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR target/51106
+       * function.c (instantiate_virtual_regs_in_insn): Use
+       delete_insn_and_edges when removing a wrong asm insn.
+
 2012-01-19  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/40761
index fcb79f5d1b88c4c6bfb8a3bf0c8f146acacad187..94e51f401c3c7e693feb93d20dac78410c5e90e1 100644 (file)
@@ -1737,7 +1737,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
       if (!check_asm_operands (PATTERN (insn)))
        {
          error_for_asm (insn, "impossible constraint in %<asm%>");
-         delete_insn (insn);
+         delete_insn_and_edges (insn);
        }
     }
   else
index 9b81745028b92dd94f0dd2889520dc2ab7471f5e..c1dd677c6bc4e857602a4b3449dcf59e7721d676 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/51106
+       * gcc.dg/torture/pr51106-1.c: New test.
+       * gcc.dg/torture/pr51106-2.c: New test.
+
 2012-01-19  Kai Tietz  <ktietz@redhat.com>
 
        * g++.dg/torture/pr51344.C: New test.
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc/testsuite/gcc.dg/torture/pr51106-1.c
new file mode 100644 (file)
index 0000000..10b3b68
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/51106 */
+/* { dg-do "compile" } */
+/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
+
+int
+foo (int x)
+{
+  asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+  return 1;
+lab:
+  return 0;
+}
+
+/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c
new file mode 100644 (file)
index 0000000..e69bf1b
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/51106 */
+/* { dg-do "compile" } */
+/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
+
+int
+bar (int x)
+{
+  asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+  __builtin_unreachable ();
+lab:
+  return 0;
+}
+
+/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */