From: Alexander Monakov Date: Wed, 13 Dec 2017 16:30:29 +0000 (+0300) Subject: sel-sched: fix sel_rank_for_schedule for qsort (PR 82398) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8041c629555ad2cbe8740d3a645332efcbd4e8d6;p=gcc.git sel-sched: fix sel_rank_for_schedule for qsort (PR 82398) PR rtl-optimization/82398 * sel-sched.c (sel_rank_for_schedule): Fix check for zero EXPR_USEFULNESS in priority comparison. From-SVN: r255607 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d992af7077..d32bd1b5c43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-13 Alexander Monakov + + PR rtl-optimization/82398 + * sel-sched.c (sel_rank_for_schedule): Fix check for zero + EXPR_USEFULNESS in priority comparison. + 2017-12-13 Segher Boessenkool PR rtl-optimization/83393 diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 87a483a231e..b6a4b7be885 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -3397,7 +3397,7 @@ sel_rank_for_schedule (const void *x, const void *y) 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);