Create an extra BB in profile-generate (PR tree-optimization/81041).
authorMartin Liska <mliska@suse.cz>
Mon, 12 Jun 2017 11:56:32 +0000 (13:56 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 12 Jun 2017 11:56:32 +0000 (11:56 +0000)
2017-06-12  Martin Liska  <mliska@suse.cz>

PR tree-optimization/81041
* tree-profile.c (gimple_gen_ic_func_profiler):
Create an extra BB in profile-generate
(gimple_gen_time_profiler): Likewise.

From-SVN: r249120

gcc/ChangeLog
gcc/tree-profile.c

index 9dbcf02abf0f4a90954e633e300ee66800b17efb..0f5444cd5b2346f179ea08af4c96c74caadbf39b 100644 (file)
@@ -1,3 +1,10 @@
+2017-06-12  Martin Liska  <mliska@suse.cz>
+
+       PR tree-optimization/81041
+       * tree-profile.c (gimple_gen_ic_func_profiler):
+       Create an extra BB in profile-generate
+       (gimple_gen_time_profiler): Likewise.
+
 2017-06-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/81003
index f5c066844022c4050f7cd61e430c5c6bbbdc7be0..2ae4b69b68ebbee9592f294fb7e5e1fd0506f070 100644 (file)
@@ -429,6 +429,10 @@ gimple_gen_ic_func_profiler (void)
   basic_block cond_bb = split_edge (single_succ_edge (entry));
   basic_block update_bb = split_edge (single_succ_edge (cond_bb));
 
+  /* We need to do an extra split in order to not create an input
+     for a possible PHI node.  */
+  split_edge (single_succ_edge (update_bb));
+
   edge true_edge = single_succ_edge (cond_bb);
   true_edge->flags = EDGE_TRUE_VALUE;
 
@@ -487,6 +491,10 @@ gimple_gen_time_profiler (unsigned tag, unsigned base)
   basic_block cond_bb = split_edge (single_succ_edge (entry));
   basic_block update_bb = split_edge (single_succ_edge (cond_bb));
 
+  /* We need to do an extra split in order to not create an input
+     for a possible PHI node.  */
+  split_edge (single_succ_edge (update_bb));
+
   edge true_edge = single_succ_edge (cond_bb);
   true_edge->flags = EDGE_TRUE_VALUE;
   true_edge->probability = PROB_UNLIKELY;