This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] sel-sched: fix sel_rank_for_schedule for qsort (PR 82398)
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Andrey Belevantsev <abel at ispras dot ru>
- Date: Wed, 13 Dec 2017 19:37:57 +0300 (MSK)
- Subject: [committed] sel-sched: fix sel_rank_for_schedule for qsort (PR 82398)
- Authentication-results: sourceware.org; auth=none
Hello,
I have applied the following patch (ack'ed by Andrey) to fix PR 82398.
The patch pasted in the Bugzilla also had a gcc_checking_assert for
VINSN_UNIQUE_P vs. SCHED_GROUP_P consistency verification earlier in that
comparator, but it's not directly related to the problem at hand, and Andrey
said he'd prefer to handle that differently.
Alexander
PR rtl-optimization/82398
* sel-sched.c (sel_rank_for_schedule): Fix check for zero
EXPR_USEFULNESS in priority comparison.
--- sel-sched.c (revision 255606)
+++ sel-sched.c (working copy)
@@ -3397,7 +3397,7 @@
return 1;
/* Prefer an expr with greater priority. */
- if (EXPR_USEFULNESS (tmp) != 0 && EXPR_USEFULNESS (tmp2) != 0)
+ if (EXPR_USEFULNESS (tmp) != 0 || EXPR_USEFULNESS (tmp2) != 0)
{
int p2 = EXPR_PRIORITY (tmp2) + EXPR_PRIORITY_ADJ (tmp2),
p1 = EXPR_PRIORITY (tmp) + EXPR_PRIORITY_ADJ (tmp);