Hi, This patch fixes ICE reported by PR81369. It simply sinks call to sort_partitions_by_post_order so that it's executed for all cases. This is necessary to schedule reduction partition as the last one. Bootstrap and test on x86_64 and AArch64. Is it OK? Thanks, bin 2017-07-12 Bin Cheng PR target/81369 * tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to function sort_partitions_by_post_order. gcc/testsuite/ChangeLog 2017-07-12 Bin Cheng PR target/81369 * gcc.dg/tree-ssa/pr81369.c: New.