From: Richard Biener Date: Tue, 24 Mar 2015 09:31:48 +0000 (+0000) Subject: re PR middle-end/65517 (ICE: in get_loop_body, at cfgloop.c:856) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bdb3744886f71ac1aab86a30bc25a8ca9c8119a2;p=gcc.git re PR middle-end/65517 (ICE: in get_loop_body, at cfgloop.c:856) 2015-03-24 Richard Biener PR middle-end/65517 * tree-cfg.c (remove_edge_and_dominated_blocks): Mark loops for fixup if necessary. * gcc.dg/torture/pr65517.c: New testcase. From-SVN: r221619 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fd75d24494e..94643feb286 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-24 Richard Biener + + PR middle-end/65517 + * tree-cfg.c (remove_edge_and_dominated_blocks): Mark loops + for fixup if necessary. + 2015-03-23 Sandra Loosemore * doc/extend.texi (Function Attributes): Add @cindex entries diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2deffd0c029..6e8f5b1d241 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Richard Biener + + PR middle-end/65517 + * gcc.dg/torture/pr65517.c: New testcase. + 2015-03-24 Tobias Burnus * gfortran.dg/coindexed_1.f90: Moved from diff --git a/gcc/testsuite/gcc.dg/torture/pr65517.c b/gcc/testsuite/gcc.dg/torture/pr65517.c new file mode 100644 index 00000000000..a63a03a870a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr65517.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +typedef void (*argmatch_exit_fn)(); +int a; +void __argmatch_die () { __builtin_exit (0); } + +int +main () +{ + while (1) + { + argmatch_exit_fn b = __argmatch_die; + if (a) + b (); + } + return 0; +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 0f5e428124c..98d6ba448fa 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -7824,6 +7824,13 @@ remove_edge_and_dominated_blocks (edge e) basic_block bb, dbb; bitmap_iterator bi; + /* If we are removing a path inside a non-root loop that may change + loop ownership of blocks or remove loops. Mark loops for fixup. */ + if (current_loops + && loop_outer (e->src->loop_father) != NULL + && e->src->loop_father == e->dest->loop_father) + loops_state_set (LOOPS_NEED_FIXUP); + if (!dom_info_available_p (CDI_DOMINATORS)) { remove_edge (e);