[Bug rtl-optimization/42429] Miscompilation of 2fish on s390
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Dec 19 18:40:00 GMT 2009
------- Comment #4 from jakub at gcc dot gnu dot org 2009-12-19 18:40 -------
After sched1 we have:
(insn 6094 6056 6069 83 u4.c:511 (set (reg:QI 5621)
(mem/s/u/j:QI (plus:SI (reg/f:SI 5441)
(reg:SI 5619)) [0 q1 S1 A8])) 73 {*movqi} (expr_list:REG_DEAD
(reg:SI 5619)
(expr_list:REG_EQUAL (mem/s/u/j:QI (plus:SI (reg:SI 5619)
(symbol_ref:SI ("q1") [flags 0x402] <var_decl
0x7f2ced1c55a0 q1>)) [0 q1 S1 A8])
(nil))))
...
(insn 6096 6058 6071 83 u4.c:511 (parallel [
(set (subreg:SI (reg:QI 5620) 0)
(xor:SI (subreg:SI (reg:QI 5621) 0)
(subreg:SI (reg:QI 5622) 0)))
(clobber (reg:CC 33 %cc))
]) 392 {*xorsi3} (expr_list:REG_DEAD (reg:QI 5622)
(expr_list:REG_DEAD (reg:QI 5621)
(expr_list:REG_UNUSED (reg:CC 33 %cc)
(nil)))))
The register pressure is extremely high (unnecessarily so, but that's tree opt
issue), so reg:QI 5621 is
spilled:
(insn 10902 6056 10903 83 u4.c:511 (set (reg:SI 14 %r14)
(symbol_ref:SI ("q1") [flags 0x402] <var_decl 0x7f2ced1c55a0 q1>)) 65
{*movsi_larl} (nil))
(insn 10903 10902 10901 83 u4.c:511 (set (reg:QI 9 %r9)
(mem/s/u/j:QI (plus:SI (reg:SI 14 %r14)
(reg:SI 3 %r3 [5619])) [0 q1 S1 A8])) 73 {*movqi} (nil))
(insn 10901 10903 6094 83 u4.c:511 (set (reg:SI 14 %r14)
(const_int 4096 [0x1000])) 67 {*movsi_esa} (nil))
(insn 6094 10901 10904 83 u4.c:511 (set (mem/c:QI (plus:SI (plus:SI (reg/f:SI
15 %r15)
(reg:SI 14 %r14))
(const_int 519 [0x207])) [7 %sfp+-137 S1 A8])
(reg:QI 9 %r9)) 73 {*movqi} (expr_list:REG_EQUAL (mem/s/u/j:QI (plus:SI
(reg:SI 3 %r3 [5619])
(symbol_ref:SI ("q1") [flags 0x402] <var_decl 0x7f2ced1c55a0
q1>)) [0 q1 S1 A8])
(nil)))
...
(insn 10912 10913 6096 83 u4.c:511 (set (reg:SI 4 %r4)
(const_int 4096 [0x1000])) 67 {*movsi_esa} (nil))
(insn 6096 10912 10915 83 u4.c:511 (parallel [
(set (reg:SI 0 %r0)
(xor:SI (reg:SI 0 %r0 [+-3 ])
(mem/c:SI (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 4 %r4))
(const_int 516 [0x204])) [7 %sfp+-140 S1 A8])))
(clobber (reg:CC 33 %cc))
]) 392 {*xorsi3} (nil))
Note it is spilled as QImode and restored using SImode.
But then DSE2 kills insn 6094:
**scanning insn=6094
cselib lookup (reg:SI 14 %r14) => 8095
cselib lookup (reg/f:SI 15 %r15) => 1
cselib value 12760 0x254ba00 (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 14 %r14))
(const_int 519 [0x207]))
...
**scanning insn=6096
cselib lookup (reg:SI 4 %r4) => 8095
cselib lookup (reg/f:SI 15 %r15) => 1
cselib lookup (reg/f:SI 15 %r15) => 1
cselib lookup (reg:SI 4 %r4) => 8095
cselib lookup (reg/f:SI 15 %r15) => 1
cselib lookup (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 4 %r4))
(const_int 516 [0x204])) => 12757
mem: (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 4 %r4))
(const_int 516 [0x204]))
after canon_rtx address: (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 4 %r4))
(const_int 516 [0x204]))
expanding: r4 into: (const_int 4096 [0x1000])
after cselib_expand address: (plus:SI (reg/f:SI 15 %r15)
(const_int 4612 [0x1204]))
after canon_rtx address: (plus:SI (reg/f:SI 15 %r15)
(const_int 4612 [0x1204]))
cselib lookup (reg/f:SI 15 %r15) => 1
varying cselib base=1 offset = 4612
processing cselib load mem:(mem/c:SI (plus:SI (plus:SI (reg/f:SI 15 %r15)
(reg:SI 4 %r4))
(const_int 516 [0x204])) [7 %sfp+-140 S1 A8])
processing cselib load against insn 6094
processing cselib load against insn 10898
mems_found = 0, cannot_delete = true
...
cselib lookup (reg/f:SI 15 %r15) => 1
varying cselib base=1 offset = 4612
processing cselib store [4612..4616)
trying store in insn=6094 gid=-1[4615..4616)
Locally deleting insn 6094
deferring deletion of insn with uid = 6094.
trying store in insn=10898 gid=-1[1223..1224)
...
deleting insn with uid = 6094.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42429
More information about the Gcc-bugs
mailing list