Hello.

This is patch for i586 bootstrap that is triggered by bug in detail described
in the PR.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

gcc/ChangeLog:

2018-01-09  Martin Liska  <mli...@suse.cz>

        PR bootstrap/82831
        * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
        * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
        partitioning.
        * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
        CLEANUP_NO_PARTITIONING is not set.
---
 gcc/basic-block.h | 1 +
 gcc/bb-reorder.c  | 2 +-
 gcc/cfgcleanup.c  | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index b9394cdb1f2..823627a14a8 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -506,6 +506,7 @@ ei_cond (edge_iterator ei, edge *p)
 					   insns.  */
 #define CLEANUP_CFGLAYOUT	32	/* Do cleanup in cfglayout mode.  */
 #define CLEANUP_CFG_CHANGED	64      /* The caller changed the CFG.  */
+#define CLEANUP_NO_PARTITIONING	128     /* Do not try to fix partitions.  */
 
 /* Return true if BB is in a transaction.  */
 
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index f977082de5a..9d18fcc495f 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -2575,7 +2575,7 @@ pass_reorder_blocks::execute (function *fun)
   cfg_layout_initialize (CLEANUP_EXPENSIVE);
 
   reorder_basic_blocks ();
-  cleanup_cfg (CLEANUP_EXPENSIVE);
+  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_NO_PARTITIONING);
 
   FOR_EACH_BB_FN (bb, fun)
     if (bb->next_bb != EXIT_BLOCK_PTR_FOR_FN (fun))
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 43d18766d8a..eebbe8f7959 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -3012,7 +3012,8 @@ try_optimize_cfg (int mode)
                  to detect and fix during edge forwarding, and in some cases
                  is only visible after newly unreachable blocks are deleted,
                  which will be done in fixup_partitions.  */
-	      fixup_partitions ();
+	      if ((mode & CLEANUP_NO_PARTITIONING) == 0)
+		fixup_partitions ();
 	      checking_verify_flow_info ();
             }
 

Reply via email to