[PATCH] preserve EDGE_DFS_BACK across split_edge

Richard Biener rguenther@suse.de
Tue May 12 06:29:57 GMT 2020


This moves EDGE_DFS_BACK to the appropriate edge when the split
edge had it set.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

2020-05-12  Richard Biener  <rguenther@suse.de>

	* cfghooks.c (split_edge): Preserve EDGE_DFS_BACK if set.
---
 gcc/cfghooks.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index ea558b46947..71c6b63ad3b 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -640,6 +640,7 @@ split_edge (edge e)
   profile_count count = e->count ();
   edge f;
   bool irr = (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
+  bool back = (e->flags & EDGE_DFS_BACK) != 0;
   class loop *loop;
   basic_block src = e->src, dest = e->dest;
 
@@ -659,6 +660,11 @@ split_edge (edge e)
       single_pred_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP;
       single_succ_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP;
     }
+  if (back)
+    {
+      single_pred_edge (ret)->flags &= ~EDGE_DFS_BACK;
+      single_succ_edge (ret)->flags |= EDGE_DFS_BACK;
+    }
 
   if (dom_info_available_p (CDI_DOMINATORS))
     set_immediate_dominator (CDI_DOMINATORS, ret, single_pred (ret));
-- 
2.16.4


More information about the Gcc-patches mailing list