Commit 609524d2 by Jakub Jelinek

re PR middle-end/57499 (ICE when noreturn destructor returns after throw with -O)

	PR middle-end/57499
	* tree-eh.c (cleanup_empty_eh): Bail out on totally empty
	bb with no successors.

	* g++.dg/torture/pr57499.C: New test.

From-SVN: r207504
parent 05ab6e21
2014-02-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57499
* tree-eh.c (cleanup_empty_eh): Bail out on totally empty
bb with no successors.
2014-02-05 James Greenhalgh <james.greenhalgh@arm.com> 2014-02-05 James Greenhalgh <james.greenhalgh@arm.com>
PR target/59718 PR target/59718
......
2014-02-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57499
* g++.dg/torture/pr57499.C: New test.
2014-02-05 Yury Gribov <y.gribov@samsung.com> 2014-02-05 Yury Gribov <y.gribov@samsung.com>
* gcc.dg/asan/nosanitize-and-inline.c: : New test. * gcc.dg/asan/nosanitize-and-inline.c: New test.
2014-02-04 Jan Hubicka <hubicka@ucw.cz> 2014-02-04 Jan Hubicka <hubicka@ucw.cz>
......
// PR middle-end/57499
// { dg-do compile }
struct S
{
~S () __attribute__ ((noreturn)) {} // { dg-warning "function does return" }
};
void
foo ()
{
S s;
throw 1;
}
...@@ -4396,8 +4396,11 @@ cleanup_empty_eh (eh_landing_pad lp) ...@@ -4396,8 +4396,11 @@ cleanup_empty_eh (eh_landing_pad lp)
/* If the block is totally empty, look for more unsplitting cases. */ /* If the block is totally empty, look for more unsplitting cases. */
if (gsi_end_p (gsi)) if (gsi_end_p (gsi))
{ {
/* For the degenerate case of an infinite loop bail out. */ /* For the degenerate case of an infinite loop bail out.
if (infinite_empty_loop_p (e_out)) If bb has no successors and is totally empty, which can happen e.g.
because of incorrect noreturn attribute, bail out too. */
if (e_out == NULL
|| infinite_empty_loop_p (e_out))
return ret; return ret;
return ret | cleanup_empty_eh_unsplit (bb, e_out, lp); return ret | cleanup_empty_eh_unsplit (bb, e_out, lp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment