aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2017-12-13 19:30:29 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2017-12-13 19:30:29 +0300
commit8041c629555ad2cbe8740d3a645332efcbd4e8d6 (patch)
treef15af175aae31fcaf15d8191bab2fa45e2d2e81e
parent2046f23f52d5ed4299f12e5f98a88491e4936c44 (diff)
downloadgcc-8041c629555ad2cbe8740d3a645332efcbd4e8d6.zip
gcc-8041c629555ad2cbe8740d3a645332efcbd4e8d6.tar.gz
gcc-8041c629555ad2cbe8740d3a645332efcbd4e8d6.tar.bz2
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/sel-sched.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5d992af..d32bd1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 87a483a..b6a4b7b 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);