aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2017-07-20 11:27:31 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2017-07-20 11:27:31 +0000
commit77e5edafafd54b6a68f56e2fb8be67a4dd68ec0c (patch)
treedca9635e1c7a90ba3710ab30b39797c71afd824e /gcc/cfgbuild.c
parent891ad31c7b151704de655a1a2b70568830a65086 (diff)
downloadgcc-77e5edafafd54b6a68f56e2fb8be67a4dd68ec0c.zip
gcc-77e5edafafd54b6a68f56e2fb8be67a4dd68ec0c.tar.gz
gcc-77e5edafafd54b6a68f56e2fb8be67a4dd68ec0c.tar.bz2
re PR middle-end/81030 (ICE on valid code at -O1 (only) on x86_64-linux-gnu: verify_flow_info failed)
PR middle-end/81030 * cfgbuild.c (find_many_sub_basic_blocks): Update REG_BR_PROB note when gimple level profile disagrees with what RTL expander did. * gcc.dg/pr81030.c: New test. From-SVN: r250383
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r--gcc/cfgbuild.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 16b0707..2fe74c4 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -673,10 +673,18 @@ find_many_sub_basic_blocks (sbitmap blocks)
&& profile_status_for_fn (cfun) != PROFILE_READ))
bb->count = profile_count::uninitialized ();
}
- else
- /* If nothing changed, there is no need to create new BBs. */
- if (EDGE_COUNT (bb->succs) == n_succs[bb->index])
+ /* If nothing changed, there is no need to create new BBs. */
+ else if (EDGE_COUNT (bb->succs) == n_succs[bb->index])
+ {
+ /* In rare occassions RTL expansion might have mistakely assigned
+ a probabilities different from what is in CFG. This happens
+ when we try to split branch to two but optimize out the
+ second branch during the way. See PR81030. */
+ if (JUMP_P (BB_END (bb)) && any_condjump_p (BB_END (bb))
+ && EDGE_COUNT (bb->succs) >= 2)
+ update_br_prob_note (bb);
continue;
+ }
compute_outgoing_frequencies (bb);
}