On 2018-09-10 8:35 AM, Andreas Schwab wrote:
On Sep 06 2018, Jeff Law <l...@redhat.com> wrote:

On 09/03/2018 08:32 AM, John David Anglin wrote:
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


sel-sched.c.d


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.
OK.
That breaks ia64.

during RTL pass: mach
/usr/local/gcc/test/gcc/testsuite/gcc.c-torture/compile/20010102-1.c: In 
function '_obstack_newchunk':
/usr/local/gcc/test/gcc/testsuite/gcc.c-torture/compile/20010102-1.c:101:1: 
internal compiler error: in sel_target_adjust_priority, at sel-sched.c:3333
0x40000000010bb68f sel_target_adjust_priority
        ../../gcc/sel-sched.c:3333
0x40000000010bb68f fill_vec_av_set
        ../../gcc/sel-sched.c:3727
0x40000000010bd45f fill_ready_list
        ../../gcc/sel-sched.c:4028
0x40000000010bd45f find_best_expr
        ../../gcc/sel-sched.c:4388
0x40000000010bd45f fill_insns
        ../../gcc/sel-sched.c:5549
0x40000000010c29cf schedule_on_fences
        ../../gcc/sel-sched.c:7366
0x40000000010c29cf sel_sched_region_2
        ../../gcc/sel-sched.c:7504
0x40000000010c510f sel_sched_region_1
        ../../gcc/sel-sched.c:7546
0x40000000010c700f sel_sched_region(int)
        ../../gcc/sel-sched.c:7647
0x40000000010c9def run_selective_scheduling()
        ../../gcc/sel-sched.c:7733
0x40000000019e473f ia64_reorg
        ../../gcc/config/ia64/ia64.c:9857
0x40000000010314cf execute
        ../../gcc/reorg.c:3984
It looks like negative priorities occur on ia64.  If that's reasonable, then the assert should be removed.
On the other hand, maybe there is a bug in setting the expression priority.

Dave

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

Reply via email to