[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #1 from Andreas Schwab  ---
Created attachment 46681
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46681&action=edit
Preprocessed sources with Makefile, part 1

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #2 from Andreas Schwab  ---
Created attachment 46682
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46682&action=edit
Preprocessed sources with Makefile, part 2

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #3 from Andreas Schwab  ---
Created attachment 46683
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46683&action=edit
Preprocessed sources with Makefile, part 3

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #4 from Richard Earnshaw  ---
R8 is the register used for the address of the return value location when the
result cannot be stored in registers.  Are you sure that this isn't a problem
in the caller?

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #5 from Richard Earnshaw  ---
(In reply to Richard Earnshaw from comment #4)
> R8 is the register used for the address of the return value location when
> the result cannot be stored in registers.  Are you sure that this isn't a
> problem in the caller?

Scratch that, can't be the case in main.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #6 from Richard Biener  ---
So I can't reproduce with a cross easily (w/o a libc I can only
do a partial link).  Nevertheless I see some

  58:   910e63e6add x6, sp, #0x398
...
  90:   a90008c2stp x2, x2, [x6]

which is probably what was intended.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #7 from Martin Liška  ---
I'm reducing the LTO files that are needed to expose the problem..

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #8 from Richard Biener  ---
So if one can reproduce a way for a smaller testcase (likely only for trunk
then) is to -fdump-tree-optimized-gimple and make a GIMPLE FE testcase from
main()
(adding relevant typedefs from the preprocessed sources).  It may not
necessarily reproduce the issue of course...

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-08-07
 Ever confirmed|0   |1

--- Comment #9 from Martin Liška  ---
I ended up with 5 files that are needed for the issue and my backtrace is then:

│0xaaab3930subsp, sp, #0xbc0
│0xaaab3934  stpx29, x30, [sp]
│0xaaab3938  movx29, sp
│0xaaab393c stpx19, x20, [sp, #16]
│0xaaab3940 stpx23, x24, [sp, #48]
│0xaaab3944 subsp, sp, #0x260
│0xaaab3948 addx9, sp, #0x390
│0xaaab394c movw23, w0
│0xaaab3950 movw0, #0x
// #-1
│0xaaab3954 movx24, x1
│0xaaab3958 strxzr, [sp, #928]
│0xaaab395c stpwzr, w0, [x9, #-8]
│0xaaab3960 stpwzr, w0, [x9]
│0xaaab3964 strxzr, [sp, #936]
│0xaaab3968 bl 0xaaab2d20

│0xaaab396c strx0, [sp, #752]
│0xaaab3970 cbzx0, 0xaaab46f0

│0xaaab3974 strx21, [sp, #640]
│0xaaab3978 adrp   x1, 0xaaac4000
<__for_each_matched_rec+48>
│0xaaab397c strx22, [sp, #648]
│0xaaab3980 addx1, x1, #0x6c8
│0xaaab3984 strx25, [sp, #672]
│0xaaab3988 addx0, sp, #0x460
│0xaaab398c strx26, [sp, #680]
│0xaaab3990 addx8, sp, #0x3b8
│0xaaab3994strx27, [sp, #688]
│0xaaab3998addx3, sp, #0x3c8
>│0xaaab399cstrx28, [x7]

Segfault happens at the last instruction.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #10 from Martin Liška  ---
I'm attaching all tree and rtl dumps for the problematic LTRANS unit:
https://drive.google.com/file/d/1CW4cWvpm1VVXFIP80XCf1IzYXWwTsynZ/view?usp=sharing

I can confirm what Andreas sees:

(note 8303 8031 7890 4 NOTE_INSN_PROLOGUE_END)
(insn:TI 7890 8303 7889 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 704 [0x2c0])) [63 %sfp+-2912 S8 A64])
(reg/f:DI 2 x2 [1833])) "../include/list.h":29:13 47 {*movdi_aarch64}
 (nil))
(insn 7889 7890 7887 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 712 [0x2c8])) [63 %sfp+-2904 S8 A64])
(reg/f:DI 3 x3 [1834])) "../include/list.h":29:13 47 {*movdi_aarch64}
 (nil))

gets transformed by peephole2 to:
(note 8303 8031 8556 4 NOTE_INSN_PROLOGUE_END)
(insn 8556 8303 7887 4 (parallel [
(set (mem/c:DI (plus:DI (reg:DI 7 x7)
(const_int 8 [0x8])) [63 %sfp+-2912 S8 A64])
(reg/f:DI 2 x2 [1833]))
(set (mem/c:DI (plus:DI (reg:DI 7 x7)
(const_int 16 [0x10])) [63 %sfp+-2904 S8 A64])
(reg/f:DI 3 x3 [1834]))
]) "../include/list.h":29:13 -1
 (nil))

I don't know what's the meaning of x7 register, but it's not set during main
function execution.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #11 from Martin Liška  ---
And I can also verify that adding -fno-peephole -fno-peephole2 to CFLAGS helps
to resolve the issue.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

Wilco  changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #12 from Wilco  ---
(In reply to Martin Liška from comment #10)
> I'm attaching all tree and rtl dumps for the problematic LTRANS unit:
> https://drive.google.com/file/d/1CW4cWvpm1VVXFIP80XCf1IzYXWwTsynZ/
> view?usp=sharing
> 
> I can confirm what Andreas sees:
> 
> (note 8303 8031 7890 4 NOTE_INSN_PROLOGUE_END)
> (insn:TI 7890 8303 7889 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
> (const_int 704 [0x2c0])) [63 %sfp+-2912 S8 A64])
> (reg/f:DI 2 x2 [1833])) "../include/list.h":29:13 47 {*movdi_aarch64}
>  (nil))
> (insn 7889 7890 7887 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
> (const_int 712 [0x2c8])) [63 %sfp+-2904 S8 A64])
> (reg/f:DI 3 x3 [1834])) "../include/list.h":29:13 47 {*movdi_aarch64}
>  (nil))
> 
> gets transformed by peephole2 to:
> (note 8303 8031 8556 4 NOTE_INSN_PROLOGUE_END)
> (insn 8556 8303 7887 4 (parallel [
> (set (mem/c:DI (plus:DI (reg:DI 7 x7)
> (const_int 8 [0x8])) [63 %sfp+-2912 S8 A64])
> (reg/f:DI 2 x2 [1833]))
> (set (mem/c:DI (plus:DI (reg:DI 7 x7)
> (const_int 16 [0x10])) [63 %sfp+-2904 S8 A64])
> (reg/f:DI 3 x3 [1834]))
> ]) "../include/list.h":29:13 -1
>  (nil))
> 
> I don't know what's the meaning of x7 register, but it's not set during main
> function execution.

Basically the backend can combine up to 4 loads or stores and insert an
addressing instruction so that all offsets are in range
(aarch64_gen_adjusted_ldpstp). It appears a later optimization removes the
initialization of x7 as dead and so the address is wrong.

The key question is how does one dump rtl with -flto? It doesn't work at all,
making debugging this difficult...

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #13 from Martin Liška  ---
> 
> The key question is how does one dump rtl with -flto? It doesn't work at
> all, making debugging this difficult...

It does, look:

marxin@marxinbox:/tmp> gcc -c main.c -flto
marxin@marxinbox:/tmp> gcc main.o -flto -o 
marxin@marxinbox:/tmp> gcc main.o -flto -o  -fdump-rtl-all
marxin@marxinbox:/tmp> ls -l xxx*
-rwxr-xr-x 1 marxin users 20544 Aug  7 15:28 
-rw-r--r-- 1 marxin users  1454 Aug  7 15:28 .ltrans0.233r.expand
-rw-r--r-- 1 marxin users  1041 Aug  7 15:28 .ltrans0.234r.vregs
-rw-r--r-- 1 marxin users  1042 Aug  7 15:28
.ltrans0.235r.into_cfglayout
-rw-r--r-- 1 marxin users  1997 Aug  7 15:28 .ltrans0.236r.jump
-rw-r--r-- 1 marxin users  1010 Aug  7 15:28 .ltrans0.248r.reginfo
-rw-r--r-- 1 marxin users  1069 Aug  7 15:28
.ltrans0.269r.outof_cfglayout
-rw-r--r-- 1 marxin users  1041 Aug  7 15:28 .ltrans0.270r.split1
-rw-r--r-- 1 marxin users  2389 Aug  7 15:28 .ltrans0.272r.dfinit
-rw-r--r-- 1 marxin users  2471 Aug  7 15:28 .ltrans0.273r.mode_sw
-rw-r--r-- 1 marxin users  2389 Aug  7 15:28 .ltrans0.274r.asmcons
-rw-r--r-- 1 marxin users  4419 Aug  7 15:28 .ltrans0.279r.ira
-rw-r--r-- 1 marxin users  4519 Aug  7 15:28 .ltrans0.280r.reload
-rw-r--r-- 1 marxin users  2158 Aug  7 15:28
.ltrans0.282r.postreload_jump
-rw-r--r-- 1 marxin users  2126 Aug  7 15:28 .ltrans0.285r.split2
-rw-r--r-- 1 marxin users  3635 Aug  7 15:28
.ltrans0.289r.pro_and_epilogue
-rw-r--r-- 1 marxin users  3178 Aug  7 15:28 .ltrans0.292r.jump2
-rw-r--r-- 1 marxin users  3228 Aug  7 15:28 .ltrans0.305r.stack
-rw-r--r-- 1 marxin users  3146 Aug  7 15:28 .ltrans0.306r.alignments
-rw-r--r-- 1 marxin users  3146 Aug  7 15:28 .ltrans0.308r.mach
-rw-r--r-- 1 marxin users  3146 Aug  7 15:28 .ltrans0.309r.barriers
-rw-r--r-- 1 marxin users  3257 Aug  7 15:28 .ltrans0.314r.shorten
-rw-r--r-- 1 marxin users  3257 Aug  7 15:28 .ltrans0.315r.nothrow
-rw-r--r-- 1 marxin users  3847 Aug  7 15:28 .ltrans0.316r.dwarf2
-rw-r--r-- 1 marxin users  3257 Aug  7 15:28 .ltrans0.317r.final
-rw-r--r-- 1 marxin users  1960 Aug  7 15:28 .ltrans0.318r.dfinish

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #14 from Wilco  ---
(In reply to Martin Liška from comment #13)
> > 
> > The key question is how does one dump rtl with -flto? It doesn't work at
> > all, making debugging this difficult...
> 
> It does, look:
> 
> marxin@marxinbox:/tmp> gcc -c main.c -flto
> marxin@marxinbox:/tmp> gcc main.o -flto -o 

Ah right, so you need an explicit -o, otherwise it doesn't write the dump
files in the current directory...

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #15 from Richard Earnshaw  ---
From looking at the dumps it would appear that one of the STP generating
peepholes might have bailed out, but that some of the changes have not been
undone.

From the pass before, we have:

(insn/f:TI 8028 8027 8029 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 672 [0x2a0])) [17  S8 A8])
(reg:DI 25 x25)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 25 x25)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 672 [0x2a0])) [17  S8 A8])
(reg:DI 25 x25))
(nil
(insn/f 8029 8028 8030 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 680 [0x2a8])) [17  S8 A8])
(reg:DI 26 x26)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 26 x26)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 680 [0x2a8])) [17  S8 A8])
(reg:DI 26 x26))
(nil
(insn/f:TI 8030 8029 8031 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 688 [0x2b0])) [17  S8 A8])
(reg:DI 27 x27)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 27 x27)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 688 [0x2b0])) [17  S8 A8])
(reg:DI 27 x27))
(nil
(insn/f 8031 8030 8303 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 28 x28)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28))

Which looks like a perfect candidate for replacing with two STP instructions.

After peepholing, we have:

(insn/f:TI 8028 8027 8029 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 672 [0x2a0])) [17  S8 A8])
(reg:DI 25 x25)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 25 x25)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 672 [0x2a0])) [17  S8 A8])
(reg:DI 25 x25))
(nil
(insn/f 8029 8028 8030 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 680 [0x2a8])) [17  S8 A8])
(reg:DI 26 x26)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 26 x26)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 680 [0x2a8])) [17  S8 A8])
(reg:DI 26 x26))
(nil
(insn/f:TI 8030 8029 8031 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 688 [0x2b0])) [17  S8 A8])
(reg:DI 27 x27)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 27 x27)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 688 [0x2b0])) [17  S8 A8])
(reg:DI 27 x27))
(nil
(insn/f 8031 8030 8303 4 (set (mem/c:DI (reg:DI 7 x7) [17  S8 A8])
(reg:DI 28 x28)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 28 x28)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28))
(nil

And we can see that the last insn has been modified.  There's nothing earlier
in the log to suggest that there was any substitution here.

My suspicion is this hunk:

  replace_equiv_address_nv (mem_1, plus_constant (Pmode, operands[8],
  new_off_1), true);
  replace_equiv_address_nv (mem_2, plus_constant (Pmode, operands[8],
  new_off_1 + msize), true);
  replace_equiv_address_nv (mem_3, plus_constant (Pmode, operands[8],
  new_off_3), true);
  replace_equiv_address_nv (mem_4, plus_constant (Pmode, operands[8],
  new_off_3 + msize), true);

  if (!aarch64_mem_pair_operand (mem_1, mode)
  || !aarch64_mem_pair_operand (mem_3, mode))
return false;

Is somehow modifying the insn in-place, but then the test is failing somehow.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

Richard Earnshaw  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rearnsha at gcc dot 
gnu.org

--- Comment #16 from Richard Earnshaw  ---
I had the wrong set of insns previously. The problem cases are:

(insn/f 8031 8030 8303 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 28 x28)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28))
(nil
(note 8303 8031 7890 4 NOTE_INSN_PROLOGUE_END)
(insn:TI 7890 8303 7889 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 704 [0x2c0])) [63 %sfp+-2912 S8 A64])
(reg/f:DI 2 x2 [1833])) "../include/list.h":29:13 47 {*movdi_aarch64}
 (nil))
(insn 7889 7890 7887 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 712 [0x2c8])) [63 %sfp+-2904 S8 A64])
(reg/f:DI 3 x3 [1834])) "../include/list.h":29:13 47 {*movdi_aarch64}
 (nil))
(insn:TI 7887 7889 229 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 720 [0x2d0])) [63 %sfp+-2896 S8 A64])
(reg/f:DI 4 x4 [1838])) "log.c":422:11 47 {*movdi_aarch64}
 (nil))

Which after peephole2 is transformed to:

(insn/f 8031 8030 8303 4 (set (mem/c:DI (reg:DI 7 x7) [17  S8 A8])
(reg:DI 28 x28)) 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg:DI 28 x28)
(expr_list:REG_CFA_OFFSET (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
(const_int 696 [0x2b8])) [17  S8 A8])
(reg:DI 28 x28))
(nil
(note 8303 8031 8556 4 NOTE_INSN_PROLOGUE_END)
(insn 8556 8303 7887 4 (parallel [
(set (mem/c:DI (plus:DI (reg:DI 7 x7)
(const_int 8 [0x8])) [63 %sfp+-2912 S8 A64])
(reg/f:DI 2 x2 [1833]))
(set (mem/c:DI (plus:DI (reg:DI 7 x7)
(const_int 16 [0x10])) [63 %sfp+-2904 S8 A64])
(reg/f:DI 3 x3 [1834]))
]) "../include/list.h":29:13 -1
 (nil))
(insn:TI 7887 8556 8557 4 (set (mem/c:DI (plus:DI (reg:DI 7 x7)
(const_int 24 [0x18])) [63 %sfp+-2896 S8 A64])
(reg/f:DI 4 x4 [1838])) "log.c":422:11 47 {*movdi_aarch64}
 (expr_list:REG_DEAD (reg/f:DI 4 x4 [1838])
(nil)))

In this case, it looks like one of the 4-store peepholes has been partially
applied, and then failed for some reason, but the modifications have not been
unwound.  (there is then a second peephole that does match the second and third
stores which confuses things a bit).

The reason for the non-match is that one of the insns has a frame-related note
set on it, but the peephole produces three output isns and we can't handle
that.

I think the fix is to make a full copy of the mems before doing the adjust;
then if the change is unwound we haven't modified the original insns by
mistake.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-07 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #17 from Richard Earnshaw  ---
Created attachment 46686
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46686&action=edit
candidate patch

Could you try this patch please?  So far only very lightly tested.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #18 from Martin Liška  ---
(In reply to Richard Earnshaw from comment #17)
> Created attachment 46686 [details]
> candidate patch
> 
> Could you try this patch please?  So far only very lightly tested.

Sure, I'll test the problematic package build with your patch.

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

Martin Liška  changed:

   What|Removed |Added

  Known to fail||10.0, 9.1.0

--- Comment #19 from Martin Liška  ---
Good I can confirm the patch works for the package!

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-09 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

--- Comment #20 from Richard Earnshaw  ---
Author: rearnsha
Date: Fri Aug  9 16:14:59 2019
New Revision: 274238

URL: https://gcc.gnu.org/viewcvs?rev=274238&root=gcc&view=rev
Log:
[aarch64] PR target/91386 Use copy_rtx to avoid modifying original insns in
peep2 pattern

PR target/91386 is a situation where a peephole2 pattern substitution
is discarded late because the selected instructions contain
frame-related notes that we cannot redistribute (because the pattern
has more than one insn in the output).  Unfortunately, the original
insns were being modified during the generation, so after the undo we
are left with corrupt RTL.

We avoid this by ensuring that the modifications are always made on a
copy, so that the original insns are never changed.

PR target/91386
* config/aarch64/aarch64.c (aarch64_gen_adjusted_ldpstp): Use copy_rtx
to preserve the contents of the original insns.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64.c

[Bug target/91386] open-iscsi iscsiadm miscompiled by LTO on aarch64

2019-08-09 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386

Richard Earnshaw  changed:

   What|Removed |Added

  Known to fail|10.0|

--- Comment #21 from Richard Earnshaw  ---
Fixed on trunk.