Sorting by node order in lto partitioning is incorrectly reversed.
For default balanced partitioning this caused all noreorder symbols
to be partitioned into a single partition where they were sorted again,
but correctly.
gcc/lto/ChangeLog:
* lto-partition.cc (cmp_partitions_order): Reverse sort.
(node_cmp): Reverse sort.
ordera = lto_symtab_encoder_deref (pa->encoder, 0)->order;
if (lto_symtab_encoder_size (pb->encoder))
orderb = lto_symtab_encoder_deref (pb->encoder, 0)->order;
- return orderb - ordera;
+ return ordera - orderb;
}
/* Create new partition with name NAME.
{
const symtab_node *a = *static_cast<const symtab_node * const *> (pa);
const symtab_node *b = *static_cast<const symtab_node * const *> (pb);
- return b->order - a->order;
+ return a->order - b->order;
}
/* Add all symtab nodes from NEXT_NODE to PARTITION in order. */