Patchwork Fix -fwhopr testsuite failures

login
register
mail settings
Submitter Jan Hubicka
Date Oct. 7, 2010, 11:15 a.m.
Message ID <20101007111533.GB5152@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/67035/
State New
Headers show

Comments

Jan Hubicka - Oct. 7, 2010, 11:15 a.m.
Hi,
this fixes the whopr partitioning problems.  With updated visibility that got
into mainline in meantime we now get into situation where we decide to end
partition just at the last node.  This makes us to create empty extra partition
and because there is sanity check in streaming that partitions are not empty,
we get an ICE.

Fixed thus, bootstrapped/regtested x86_64-linux, will commit it shortly as obvious.

Honza

	* lto.c (lto_balanced_map): Do not produce empty partitions.

Patch

Index: lto/lto.c
===================================================================
--- lto/lto.c	(revision 165087)
+++ lto/lto.c	(working copy)
@@ -1212,6 +1208,9 @@ 
 	      undo_partition (partition, best_n_nodes, best_n_varpool_nodes);
 	    }
 	  i = best_i;
+ 	  /* When we are finished, avoid creating empty partition.  */
+	  if (i == n_nodes - 1)
+	    break;
 	  partition = new_partition ("");
 	  last_visited_cgraph_node = 0;
 	  last_visited_varpool_node = 0;