Commit c2893c6e by Jan Hubicka Committed by Jan Hubicka

re PR tree-optimization/83189 (internal compiler error: in probability_in, at profile-count.h:1050)

	PR middle-end/83189
	* gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.

From-SVN: r256545
parent 0526ed2a
2018-01-11 Jan Hubicka <hubicka@ucw.cz> 2018-01-11 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83189
* gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.
2018-01-11 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83718 PR middle-end/83718
* tree-inline.c (copy_cfg_body): Adjust num&den for scaling * tree-inline.c (copy_cfg_body): Adjust num&den for scaling
after they are computed. after they are computed.
......
...@@ -138,6 +138,7 @@ isolate_path (basic_block bb, basic_block duplicate, ...@@ -138,6 +138,7 @@ isolate_path (basic_block bb, basic_block duplicate,
edge_iterator ei; edge_iterator ei;
edge e2; edge e2;
bool impossible = true; bool impossible = true;
profile_count count = e->count ();
for (si = gsi_start_bb (bb); gsi_stmt (si) != stmt; gsi_next (&si)) for (si = gsi_start_bb (bb); gsi_stmt (si) != stmt; gsi_next (&si))
if (stmt_can_terminate_bb_p (gsi_stmt (si))) if (stmt_can_terminate_bb_p (gsi_stmt (si)))
...@@ -154,11 +155,12 @@ isolate_path (basic_block bb, basic_block duplicate, ...@@ -154,11 +155,12 @@ isolate_path (basic_block bb, basic_block duplicate,
if (!duplicate) if (!duplicate)
{ {
duplicate = duplicate_block (bb, NULL, NULL); duplicate = duplicate_block (bb, NULL, NULL);
bb->count = profile_count::zero (); duplicate->count = profile_count::zero ();
if (!ret_zero) if (!ret_zero)
for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); ) for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); )
remove_edge (e2); remove_edge (e2);
} }
bb->count -= count;
/* Complete the isolation step by redirecting E to reach DUPLICATE. */ /* Complete the isolation step by redirecting E to reach DUPLICATE. */
e2 = redirect_edge_and_branch (e, duplicate); e2 = redirect_edge_and_branch (e, duplicate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment