aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-05-19 08:23:37 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-05-19 08:23:37 +0000
commit035ab82621cd702bb7fc566ca7ccbcb6a9567058 (patch)
treeac85c22d0871839024511e1895e6d1ca0b09ab10 /gcc/cfgexpand.c
parentf0da130005c12d8544a7c9898a9001e4b7f11ee2 (diff)
downloadgcc-035ab82621cd702bb7fc566ca7ccbcb6a9567058.zip
gcc-035ab82621cd702bb7fc566ca7ccbcb6a9567058.tar.gz
gcc-035ab82621cd702bb7fc566ca7ccbcb6a9567058.tar.bz2
re PR middle-end/80764 (ICE at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in verify_loop_structure, at cfgloop.c:1644))
2017-05-19 Richard Biener <rguenther@suse.de> PR middle-end/80764 * cfgexpand.c (expand_gimple_cond): Fix loop fixup. * gcc.dg/torture/pr80764.c: New testcase. From-SVN: r248261
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index e38c8e4..9965310 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2503,7 +2503,10 @@ expand_gimple_cond (basic_block bb, gcond *stmt)
false_edge->flags |= EDGE_FALLTHRU;
new_bb->count = false_edge->count;
new_bb->frequency = EDGE_FREQUENCY (false_edge);
- add_bb_to_loop (new_bb, bb->loop_father);
+ 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;
new_edge = make_edge (new_bb, dest, 0);
new_edge->probability = REG_BR_PROB_BASE;
new_edge->count = new_bb->count;