https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84068
--- Comment #5 from Wilco <wilco at gcc dot gnu.org> --- Author: wilco Date: Thu Feb 8 12:29:28 2018 New Revision: 257481 URL: https://gcc.gnu.org/viewcvs?rev=257481&root=gcc&view=rev Log: PR84068, PR83459: Fix sort order of SCHED_PRESSURE_MODEL The comparison function for SCHED_PRESSURE_MODEL is incorrect. If either instruction is not in target_bb, the ordering is not well defined. Since all instructions outside the target_bb get the highest model_index, all we need to do is sort on model_index. If the model_index is the same we defer to RFS_DEP_COUNT and/or RFS_TIE. gcc/ PR rtl-optimization/84068 PR rtl-optimization/83459 * haifa-sched.c (rank_for_schedule): Fix SCHED_PRESSURE_MODEL sorting. gcc/testsuite PR rtl-optimization/84068 PR rtl-optimization/83459 * gcc.dg/pr84068.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr84068.c Modified: trunk/gcc/ChangeLog trunk/gcc/haifa-sched.c trunk/gcc/testsuite/ChangeLog