+2017-07-18 Jan Hubicka <hubicka@ucw.cz>
+ Tom de Vries <tom@codesourcery.com>
+
+ 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.
+
2017-07-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/61171
&& 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);
}
+2017-07-17 Tom de Vries <tom@codesourcery.com>
+
+ PR middle-end/81030
+ * gcc.dg/pr81030.c: New test.
+
2017-07-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/61171
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+void __assert_fail (const char *, const char *, unsigned int, const char *);
+
+int a, b, c, d, e, f, h;
+unsigned char g;
+
+int main ()
+{
+ int i, *j = &b;
+ if (a)
+ {
+ if (h)
+ {
+ int **k = &j;
+ d = 0;
+ *k = &e;
+ }
+ else
+ for (b = 0; b > -28; b = g)
+ ;
+ c || !j ? : __assert_fail ("c || !j", "small.c", 20, "main");
+ if (f)
+ for (i = 0; i < 1; i++)
+ ;
+ }
+ return 0;
+}