The documentation for TARGET_SCHED_ADJUST_PRIORITY indicates that the hook can reduce the priority of INSN to execute it later.  The hppa hook only reduces the priority and it has been this way for years.  However, the assert in sel_target_adjust_priority()
prevents reduction of the priority.

The attached change revises the assert to allow the priority to be reduced to zero.

This fixes PR rtl-optimization/85458.

Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

I must admit that this happens so infrequently that I have to wonder if the hook provides any benefit on hppa.  It was supposed to keep addil instructions close to the following instruction
to reduce pressure on register %r1.

Okay?

Dave

--
John David Anglin  dave.ang...@bell.net

2018-09-03  John David Anglin  <dang...@gcc.gnu.org>

        PR rtl-optimization/85458
        * sel-sched.c (sel_target_adjust_priority): Allow backend adjust
        priority hook to reduce the priority of EXPR.

Index: sel-sched.c
===================================================================
--- sel-sched.c (revision 264045)
+++ sel-sched.c (working copy)
@@ -3330,11 +3330,11 @@
   else
     new_priority = priority;
 
+  gcc_assert (new_priority >= 0);
+
   /* If the priority has changed, adjust EXPR_PRIORITY_ADJ accordingly.  */
   EXPR_PRIORITY_ADJ (expr) = new_priority - EXPR_PRIORITY (expr);
 
-  gcc_assert (EXPR_PRIORITY_ADJ (expr) >= 0);
-
   if (sched_verbose >= 4)
     sel_print ("sel_target_adjust_priority: insn %d,  %d+%d = %d.\n",
               INSN_UID (EXPR_INSN_RTX (expr)), EXPR_PRIORITY (expr),

Reply via email to