Commit 7496868d by Jan Hubicka Committed by Jan Hubicka

re PR lto/48246 (ICE in lto_wpa_write_files)

	PR lto/23754
	* lto.c (lto_1_to_1_map): Don't create empty partitions.
	(lto_balanced_map): Likewise.

From-SVN: r175174
parent 96769d32
2011-06-11 Jan Hubicka <jh@suse.cz> 2011-06-11 Jan Hubicka <jh@suse.cz>
PR lto/23754
* lto.c (lto_1_to_1_map): Don't create empty partitions.
(lto_balanced_map): Likewise.
2011-06-11 Jan Hubicka <jh@suse.cz>
* lto.c (add_cgraph_node_to_partition_1): Break out from ... * lto.c (add_cgraph_node_to_partition_1): Break out from ...
(add_cgraph_node_to_partition) ... here; walk aliases. (add_cgraph_node_to_partition) ... here; walk aliases.
(lto_1_to_1_map): Remove same body alias code. (lto_1_to_1_map): Remove same body alias code.
......
...@@ -1516,7 +1516,8 @@ lto_1_to_1_map (void) ...@@ -1516,7 +1516,8 @@ lto_1_to_1_map (void)
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
{ {
if (!partition_cgraph_node_p (node)) if (!partition_cgraph_node_p (node)
|| node->aux)
continue; continue;
file_data = node->local.lto_file_data; file_data = node->local.lto_file_data;
...@@ -1545,13 +1546,13 @@ lto_1_to_1_map (void) ...@@ -1545,13 +1546,13 @@ lto_1_to_1_map (void)
npartitions++; npartitions++;
} }
if (!node->aux)
add_cgraph_node_to_partition (partition, node); add_cgraph_node_to_partition (partition, node);
} }
for (vnode = varpool_nodes; vnode; vnode = vnode->next) for (vnode = varpool_nodes; vnode; vnode = vnode->next)
{ {
if (!partition_varpool_node_p (vnode)) if (!partition_varpool_node_p (vnode)
|| vnode->aux)
continue; continue;
file_data = vnode->lto_file_data; file_data = vnode->lto_file_data;
slot = pointer_map_contains (pmap, file_data); slot = pointer_map_contains (pmap, file_data);
...@@ -1565,7 +1566,6 @@ lto_1_to_1_map (void) ...@@ -1565,7 +1566,6 @@ lto_1_to_1_map (void)
npartitions++; npartitions++;
} }
if (!vnode->aux)
add_varpool_node_to_partition (partition, vnode); add_varpool_node_to_partition (partition, vnode);
} }
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
...@@ -1675,7 +1675,8 @@ lto_balanced_map (void) ...@@ -1675,7 +1675,8 @@ lto_balanced_map (void)
for (i = 0; i < n_nodes; i++) for (i = 0; i < n_nodes; i++)
{ {
if (!order[i]->aux) if (order[i]->aux)
continue;
add_cgraph_node_to_partition (partition, order[i]); add_cgraph_node_to_partition (partition, order[i]);
total_size -= inline_summary (order[i])->size; total_size -= inline_summary (order[i])->size;
...@@ -1856,6 +1857,8 @@ lto_balanced_map (void) ...@@ -1856,6 +1857,8 @@ lto_balanced_map (void)
} }
i = best_i; i = best_i;
/* When we are finished, avoid creating empty partition. */ /* When we are finished, avoid creating empty partition. */
while (i < n_nodes - 1 && order[i + 1]->aux)
i++;
if (i == n_nodes - 1) if (i == n_nodes - 1)
break; break;
partition = new_partition (""); partition = new_partition ("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment