From ce91f0f189e0268f369b9b439ea61def03787334 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 20 Jan 2020 12:11:20 +0100 Subject: [PATCH] Backport f48c6014133c8989702458f9082e34ba6dd326d4 Backport from mainline 2020-01-16 Martin Liska * lto-partition.c (lto_balanced_map): Remember best_noreorder_pos and then restore to it when we revert. --- gcc/lto/ChangeLog | 9 +++++++++ gcc/lto/lto-partition.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index e381db79f170..8c715129c11f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,12 @@ +2020-01-20 Martin Liska + + Backport from mainline + 2020-01-16 Martin Liska + + * lto-partition.c (lto_balanced_map): Remember + best_noreorder_pos and then restore to it + when we revert. + 2019-11-08 Jakub Jelinek Backported from mainline diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index 6972e6e9ef3b..e4860c746244 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -501,6 +501,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 order (symtab->cgraph_count); auto_vec noreorder; auto_vec varpool_order; @@ -762,6 +763,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 (dump_file) fprintf (dump_file, "Step %i: added %s/%i, size %i, " @@ -782,6 +784,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.47.2