diff mbox

[RTL] Fix PR 51106

Message ID 20120119144031.GV18768@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 19, 2012, 2:40 p.m. UTC
On Thu, Jan 19, 2012 at 06:13:58PM +0400, Andrey Belevantsev wrote:
> 2012-01-19  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.

This is ok for trunk.

> 2012-01-19  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/51106
> 	* gcc.c-torture/compile/pr51106.c: New test.

I'd prefer to explicitly test for the warnings and errors.
So something like:


	Jakub
diff mbox

Patch

--- gcc/testsuite/gcc.dg/torture/pr51106-1.c.jj	2012-01-19 15:23:28.501117223 +0100
+++ gcc/testsuite/gcc.dg/torture/pr51106-1.c	2012-01-19 15:37:20.658296791 +0100
@@ -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 } */
--- gcc/testsuite/gcc.dg/torture/pr51106-2.c.jj	2012-01-19 15:23:28.000000000 +0100
+++ gcc/testsuite/gcc.dg/torture/pr51106-2.c	2012-01-19 15:37:30.062243322 +0100
@@ -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 } */