aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-07-19 20:19:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-07-19 18:19:48 +0000
commitc525ba9a3f44ebd7ae89e3efa0bde60161c08582 (patch)
tree169470a366f41b2ba7257f4e0f43b8351feddbcc
parent3ae1e1fdf4bf24a64cfb031d1c2a44096333aa6c (diff)
downloadgcc-c525ba9a3f44ebd7ae89e3efa0bde60161c08582.zip
gcc-c525ba9a3f44ebd7ae89e3efa0bde60161c08582.tar.gz
gcc-c525ba9a3f44ebd7ae89e3efa0bde60161c08582.tar.bz2
lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder partitioning of variables.
* lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder partitioning of variables. From-SVN: r201065
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-partition.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index c2cbeed..b37a879 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,5 +1,10 @@
2013-06-20 Jan Hubicka <jh@suse.cz>
+ * lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder
+ partitioning of variables.
+
+2013-06-20 Jan Hubicka <jh@suse.cz>
+
* lto.c (read_cgraph_and_symbols): Set cgraph state.
2013-06-19 Jan Hubicka <jh@suse.cz>
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index ffc8da3..8782698 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -444,7 +444,7 @@ void
lto_balanced_map (void)
{
int n_nodes = 0;
- int n_varpool_nodes = 0, varpool_pos = 0;
+ int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
struct cgraph_node **postorder =
XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
struct cgraph_node **order = XNEWVEC (struct cgraph_node *, cgraph_max_uid);
@@ -684,6 +684,7 @@ lto_balanced_map (void)
best_i = i;
best_n_nodes = lto_symtab_encoder_size (partition->encoder);
best_total_size = total_size;
+ best_varpool_pos = varpool_pos;
}
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Step %i: added %s/%i, size %i, cost %i/%i "
@@ -701,6 +702,7 @@ lto_balanced_map (void)
fprintf (cgraph_dump_file, "Unwinding %i insertions to step %i\n",
i - best_i, best_i);
undo_partition (partition, best_n_nodes);
+ varpool_pos = best_varpool_pos;
}
i = best_i;
/* When we are finished, avoid creating empty partition. */