tree-cfg.c (gimple_split_edge): Avoid reallocating target PHI nodes.
authorRichard Biener <rguenther@suse.de>
Tue, 22 Aug 2017 09:04:28 +0000 (09:04 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 22 Aug 2017 09:04:28 +0000 (09:04 +0000)
2017-08-22  Richard Biener  <rguenther@suse.de>

* tree-cfg.c (gimple_split_edge): Avoid reallocating target
PHI nodes.

From-SVN: r251264

gcc/ChangeLog
gcc/tree-cfg.c

index e24f5119334033f7f606d840c08e6e9072cbf3d3..a32a5d6498bd8ee7a1b6baf06af12844d0ad0ba6 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-22  Richard Biener  <rguenther@suse.de>
+
+       * tree-cfg.c (gimple_split_edge): Avoid reallocating target
+       PHI nodes.
+
 2017-08-22  Richard Biener  <rguenther@suse.de>
 
        * common.opt (feliminate-dwarf2-dups): Ignore.
index f26b12ff30dce7e9d672f0129798132c2ee33fff..6c355f1ed70c6a158e29beeeef5f43577ee6d989 100644 (file)
@@ -2844,10 +2844,11 @@ gimple_split_edge (edge edge_in)
   new_bb = create_empty_bb (after_bb);
   new_bb->frequency = EDGE_FREQUENCY (edge_in);
   new_bb->count = edge_in->count;
-  new_edge = make_single_succ_edge (new_bb, dest, EDGE_FALLTHRU);
 
   e = redirect_edge_and_branch (edge_in, new_bb);
   gcc_assert (e == edge_in);
+
+  new_edge = make_single_succ_edge (new_bb, dest, EDGE_FALLTHRU);
   reinstall_phi_args (new_edge, e);
 
   return new_bb;