diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-07 17:01:54 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-07 17:01:54 +0000 |
commit | 4dfabd94845d628d135601feca4ff4bfe11c1178 (patch) | |
tree | 705e817ab10e9dde6d04bbbf7f189860002d06c1 /gcc/cfghooks.c | |
parent | 1bbf98675d582b23f3be563bf74990c5fc537b3a (diff) | |
download | gcc-4dfabd94845d628d135601feca4ff4bfe11c1178.tar.gz |
PR tree-optimization/69740
* cfghooks.c (remove_edge): Request loop fixups if we delete
an edge that might turn an irreducible loop into a natural
loop.
* cfgloop.h (check_verify_loop_structure): Clear LOOPS_NEED_FIXUP.
Move after definition of loops_state_clear.
PR tree-optimization/69740
* gcc.c-torture/compile/pr69740-1.c: New test.
* gcc.c-torture/compile/pr69740-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234036 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index bbb1017fd1f..06c05d1fb39 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -408,7 +408,20 @@ void remove_edge (edge e) { if (current_loops != NULL) - rescan_loop_exit (e, false, true); + { + rescan_loop_exit (e, false, true); + + /* Removal of an edge inside an irreducible region or which leads + to an irreducible region can turn the region into a natural loop. + In that case, ask for the loop structure fixups. + + FIXME: Note that LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS is not always + set, so always ask for fixups when removing an edge in that case. */ + if (!loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) + || (e->flags & EDGE_IRREDUCIBLE_LOOP) + || (e->dest->flags & BB_IRREDUCIBLE_LOOP)) + loops_state_set (LOOPS_NEED_FIXUP); + } /* This is probably not needed, but it doesn't hurt. */ /* FIXME: This should be called via a remove_edge hook. */ |