On Thu, Jan 19, 2012 at 06:13:58PM +0400, Andrey Belevantsev wrote: > 2012-01-19 Andrey Belevantsev <a...@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 <ja...@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: --- 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 } */ Jakub