OSDN Git Service

2012-02-09 Andrey Belevantsev <abel@ispras.ru>
authorabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Feb 2012 10:10:36 +0000 (10:10 +0000)
committerabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Feb 2012 10:10:36 +0000 (10:10 +0000)
        Backport from mainline
        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.

        Backport from mainline
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@184038 138bc75d-0d04-0410-961f-82ee72b054a4

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 fd9ed10..119534e 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-09  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline 
+       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-02-07  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR middle-end/51994
index 1f7722c..d728384 100644 (file)
@@ -1,7 +1,7 @@
 /* Expands front end tree to back end RTL for GCC.
    Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-   2010, 2011  Free Software Foundation, Inc.
+   2010, 2011, 2012 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1747,7 +1747,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 bbfd905..48b2aaf 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-09  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       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-02-08  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52151
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 } */