From a6f30e668a9d5284c0537aeba7d89190ddb9c3e9 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 29 Apr 2013 15:06:18 +0000 Subject: [PATCH] re PR tree-optimization/57075 (verify_flow_info failed: control flow in the middle of basic block) 2013-04-29 Richard Biener PR middle-end/57075 * tree-inline.c (copy_edges_for_bb): Still split the bbs, even if not adding abnormal edges for calls that can make abnormal gotos. * gcc.dg/torture/pr57075.c: New testcase. From-SVN: r198423 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr57075.c | 15 +++++++++++++++ gcc/tree-inline.c | 10 +++++----- 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr57075.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b84161bf163..38074dab23f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-04-29 Richard Biener + + PR middle-end/57075 + * tree-inline.c (copy_edges_for_bb): Still split the bbs, + even if not adding abnormal edges for calls that can make + abnormal gotos. + 2013-04-29 Richard Biener PR middle-end/57103 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 166d4e028ce..3364efcb30d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-04-29 Richard Biener + + PR middle-end/57075 + * gcc.dg/torture/pr57075.c: New testcase. + 2013-04-29 Richard Biener PR middle-end/57103 diff --git a/gcc/testsuite/gcc.dg/torture/pr57075.c b/gcc/testsuite/gcc.dg/torture/pr57075.c new file mode 100644 index 00000000000..dee74a844b1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57075.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +extern int baz (void) __attribute__ ((returns_twice)); +int __attribute__ ((__leaf__)) +foo (void) +{ + return __builtin_printf ("$"); +} + +void +bar () +{ + foo (); + baz (); +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 69455cebf79..35cdb787538 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1923,11 +1923,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb, into a COMPONENT_REF which doesn't. If the copy can throw, the original could also throw. */ can_throw = stmt_can_throw_internal (copy_stmt); - /* If the call we inline cannot make abnormal goto do not add - additional abnormal edges but only retain those already present - in the original function body. */ - nonlocal_goto - = can_make_abnormal_goto && stmt_can_make_abnormal_goto (copy_stmt); + nonlocal_goto = stmt_can_make_abnormal_goto (copy_stmt); if (can_throw || nonlocal_goto) { @@ -1955,6 +1951,10 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb, else if (can_throw) make_eh_edges (copy_stmt); + /* If the call we inline cannot make abnormal goto do not add + additional abnormal edges but only retain those already present + in the original function body. */ + nonlocal_goto &= can_make_abnormal_goto; if (nonlocal_goto) make_abnormal_goto_edges (gimple_bb (copy_stmt), true); -- 2.30.2