This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] sel-sched: fix sel_rank_for_schedule for qsort (PR 82398)


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]