https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57690
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
6.1+ produces shr:
addq $8, %rsp
.cfi_def_cfa_offset 8
shrl $2, %eax
combine dump for GCC 6.1:
Trying 8 -> 9:
Failed to match this instruction:
(set (reg:DI 91)
(zero_extract:DI (reg:SI 87 [ _3 ])
(const_int 30 [0x1e])
(const_int 2 [0x2])))
Combine dump for 5.4:
Trying 8 -> 9:
Successfully matched this instruction:
(set (reg:DI 92 [ D.1847 ])
(zero_extract:DI (subreg:DI (reg:SI 87 [ D.1846 ]) 0)
(const_int 30 [0x1e])
(const_int 2 [0x2])))
allowing combination of insns 8 and 9
original costs 4 + 1 = 5
replacement cost 4
deferring deletion of insn with uid = 8.
modifying insn i3 9: {r92:DI=zero_extract(r87:SI#0,0x1e,0x2);clobber
flags:CC;}
REG_UNUSED flags:CC
REG_DEAD r87:SI
deferring rescan insn with uid = 9.
starting the processing of deferred insns
rescanning insn with uid = 9.
ending the processing of deferred insns
But I think GCC 6.1+ is producing invalid RTL in combine. And it is no longer
matching the instruction.
I think the 6.1 behavior started with r6-2022.