sel-sched: fix sel_rank_for_schedule for qsort (PR 82398)
authorAlexander Monakov <amonakov@ispras.ru>
Wed, 13 Dec 2017 16:30:29 +0000 (19:30 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Wed, 13 Dec 2017 16:30:29 +0000 (19:30 +0300)
PR rtl-optimization/82398
* sel-sched.c (sel_rank_for_schedule): Fix check for zero
EXPR_USEFULNESS in priority comparison.

From-SVN: r255607

gcc/ChangeLog
gcc/sel-sched.c

index 5d992af707717846db57593daef91e81337342aa..d32bd1b5c4377e4c215737a1cfa798879425978f 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-13  Alexander Monakov  <amonakov@ispras.ru>
+
+       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  <segher@kernel.crashing.org>
 
        PR rtl-optimization/83393
index 87a483a231e8f6b4a719aa3e958e867f78258dd4..b6a4b7be8858316b1ac5472804aa613e1e6c16f5 100644 (file)
@@ -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);