On 10/2/18 9:59 AM, Peter Bergner wrote: > gcc/ > PR rtl-optimization/86939 > PR rtl-optimization/87479 > * ira.h (copy_insn_p): New prototype. > * ira-lives.c (ignore_reg_for_conflicts): New static variable. > (make_hard_regno_dead): Don't add conflicts for register > ignore_reg_for_conflicts. > (make_object_dead): Likewise. > (copy_insn_p): New function. > (process_bb_node_lives): Set ignore_reg_for_conflicts for copies. > Remove special conflict handling of REAL_PIC_OFFSET_TABLE_REGNUM. > * lra-lives.c (ignore_reg_for_conflicts): New static variable. > (make_hard_regno_dead): Don't add conflicts for register > ignore_reg_for_conflicts. Remove special conflict handling of > REAL_PIC_OFFSET_TABLE_REGNUM. Remove now unused argument > check_pic_pseudo_p and update callers. > (mark_pseudo_dead): Don't add conflicts for register > ignore_reg_for_conflicts. > (process_bb_lives): Set ignore_reg_for_conflicts for copies.
So bootstrap and regtesting on powerpc64le-linux show no regressions. Looking at the x86_64-linux results, I see one test suite regression: FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\), % 8 I have included the function that is compiled differently with and without the patch. Looking at the IRA rtl dumps, there is pseudo 85 that is copied from and into hard reg 5 and we now no longer report that they conflict. That allows pesudo 85 to now be assigned to hard reg 5, rather than hard reg 3 (old code) and that leads to the code differences shown below. I don't know x86_64 mnemonics enough to say whether the code changes below are "better" or "similar" or ???. H.J., can you comment on the below code gen changes? If they're better or similar to the old code, I could just modify the expected results for pr49095.c. Peter [bergner@dagger1 PR87479]$ cat pr49095.i void foo (void *); int * f1 (int *x) { if (!--*x) foo (x); return x; } [bergner@dagger1 PR87479]$ /data/bergner/gcc/build/gcc-fsf-mainline-pr87479-base-regtest/gcc/xgcc -B/data/bergner/gcc/build/gcc-fsf-mainline-pr87479-base-regtest/gcc/ -Os -fno-shrink-wrap -masm=att -ffat-lto-objects -fno-ident -S -o pr49095-base.s pr49095.i [bergner@dagger1 PR87479]$ /data/bergner/gcc/build/gcc-fsf-mainline-pr87479-regtest/gcc/xgcc -B/data/bergner/gcc/build/gcc-fsf-mainline-pr87479-regtest/gcc/ -Os -fno-shrink-wrap -masm=att -ffat-lto-objects -fno-ident -S -o pr49095-new.s pr49095.i [bergner@dagger1 PR87479]$ diff -u pr49095-base.s pr49095-new.s --- pr49095-base.s 2018-10-02 14:07:09.000000000 -0500 +++ pr49095-new.s 2018-10-02 14:07:40.000000000 -0500 @@ -5,16 +5,16 @@ f1: .LFB0: .cfi_startproc + subq $24, %rsp + .cfi_def_cfa_offset 32 decl (%rdi) - pushq %rbx - .cfi_def_cfa_offset 16 - .cfi_offset 3, -16 - movq %rdi, %rbx jne .L2 + movq %rdi, 8(%rsp) call foo + movq 8(%rsp), %rdi .L2: - movq %rbx, %rax - popq %rbx + movq %rdi, %rax + addq $24, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc