aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-05-30 07:49:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-05-30 07:49:00 +0000
commit892d61696c447025d6ccc52eb85a4ab688e122a3 (patch)
tree08f4e9146de208eae527980905c222ef699cd61b /gcc/cfgexpand.c
parent63523736d018998672b707e669d0536d10cb735e (diff)
downloadgcc-892d61696c447025d6ccc52eb85a4ab688e122a3.zip
gcc-892d61696c447025d6ccc52eb85a4ab688e122a3.tar.gz
gcc-892d61696c447025d6ccc52eb85a4ab688e122a3.tar.bz2
re PR tree-optimization/80876 (ICE in verify_loop_structure, at cfgloop.c:1644 (error: loop 1's latch does not have an edge to its header))
2017-05-30 Richard Biener <rguenther@suse.de> PR middle-end/80876 * cfgexpand.c (expand_gimple_cond): Fixup preserving loops again. * gcc.dg/torture/pr80876.c: New testcase. From-SVN: r248633
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 9965310..c5b4d70 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2504,9 +2504,9 @@ expand_gimple_cond (basic_block bb, gcond *stmt)
new_bb->count = false_edge->count;
new_bb->frequency = EDGE_FREQUENCY (false_edge);
add_bb_to_loop (new_bb, dest->loop_father);
- if (bb->loop_father->latch == bb
- && bb->loop_father->header == dest)
- bb->loop_father->latch = new_bb;
+ if (dest->loop_father->latch == bb
+ && dest->loop_father->header == dest)
+ dest->loop_father->latch = new_bb;
new_edge = make_edge (new_bb, dest, 0);
new_edge->probability = REG_BR_PROB_BASE;
new_edge->count = new_bb->count;