* lto-partition.c (lto_balanced_map): Fix sanity check.
authorJan Hubicka <jh@suse.cz>
Mon, 30 Apr 2018 11:40:47 +0000 (13:40 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 30 Apr 2018 11:40:47 +0000 (11:40 +0000)
From-SVN: r259759

gcc/lto/ChangeLog
gcc/lto/lto-partition.c

index 6d00e4e..d54ef50 100644 (file)
@@ -1,3 +1,7 @@
+2018-04-20  Jan Hubicka  <jh@suse.cz>
+
+       * lto-partition.c (lto_balanced_map): Fix sanity check.
+
 2018-04-19  Jan Hubicka  <jh@suse.cz>
 
        * lto-partition.c: Include sreal.h
index d83eba2..3efebe7 100644 (file)
@@ -809,7 +809,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
     next_nodes.safe_push (noreorder[noreorder_pos++]);
   /* For one partition the cost of boundary should be 0 unless we added final
      symbols here (these are not accounted) or we have accounting bug.  */
-  gcc_assert (next_nodes.length () || npartitions != 1 || !best_cost);
+  gcc_assert (next_nodes.length () || npartitions != 1 || !best_cost || best_cost == -1);
   add_sorted_nodes (next_nodes, partition);
 
   free (order);