Hi.

I've just tested the backport on both GCC 8 and 9 branches.

I'm going to install it.
Martin
>From 4a856551c0f969be6525371892277c206b4181da Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Mon, 20 Jan 2020 11:16:21 +0100
Subject: [PATCH] Backport f48c6014133c8989702458f9082e34ba6dd326d4

gcc/lto/ChangeLog:

2020-01-16  Martin Liska  <mli...@suse.cz>

	* lto-partition.c (lto_balanced_map): Remember
	best_noreorder_pos and then restore to it
	when we revert.
---
 gcc/lto/lto-partition.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index bf88d8a4e65..ed6f30cecb2 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -507,6 +507,7 @@ void
 lto_balanced_map (int n_lto_partitions, int max_partition_size)
 {
   int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
+  int best_noreorder_pos = 0;
   auto_vec <cgraph_node *> order (symtab->cgraph_count);
   auto_vec<cgraph_node *> noreorder;
   auto_vec<varpool_node *> varpool_order;
@@ -769,6 +770,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
 	  best_i = i;
 	  best_n_nodes = lto_symtab_encoder_size (partition->encoder);
 	  best_varpool_pos = varpool_pos;
+	  best_noreorder_pos = noreorder_pos;
 	}
       if (symtab->dump_file)
 	fprintf (symtab->dump_file, "Step %i: added %s/%i, size %i, "
@@ -789,6 +791,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
 			 i - best_i, best_i);
 	      undo_partition (partition, best_n_nodes);
 	      varpool_pos = best_varpool_pos;
+	      noreorder_pos = best_noreorder_pos;
 	    }
 	  gcc_assert (best_size == partition->insns);
 	  i = best_i;
-- 
2.24.1

Reply via email to