https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69535
Richard Henderson <rth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |rtl-optimization
--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> ---
Combine turns
(insn 35 33 36 2 (parallel [
(set (reg:SI 123 [ u32_2 ])
(lshiftrt:SI (reg/v:SI 108 [ u32_2 ])
(reg/v:QI 94 [ u8_3 ])))
(clobber (reg:CC 17 flags))
]) z.c:21 562 {*lshrsi3_1}
(expr_list:REG_DEAD (reg/v:SI 108 [ u32_2 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 36 35 59 2 (set (reg:DI 125 [ u32_2 ])
(zero_extend:DI (reg:SI 123 [ u32_2 ]))) z.c:22 131 {*zero_extendsidi2}
(expr_list:REG_DEAD (reg:SI 123 [ u32_2 ])
(nil)))
...
(insn 37 59 38 2 (set (subreg:DI (reg:TI 124 [ u32_2 ]) 0)
(reg:DI 125 [ u32_2 ])) z.c:22 85 {*movdi_internal}
(expr_list:REG_DEAD (reg:DI 125 [ u32_2 ])
(nil)))
into
(note 35 33 36 2 NOTE_INSN_DELETED)
(note 36 35 59 2 NOTE_INSN_DELETED)
(insn 37 59 38 2 (set (subreg:DI (reg:TI 124 [ u32_2 ]) 0)
(subreg:DI (reg/v:SI 108 [ u32_2 ]) 0)) z.c:22 85 {*movdi_internal}
(expr_list:REG_DEAD (reg/v:SI 108 [ u32_2 ])
(nil)))
I'm not sure how it decided to drop the lshiftrt, but the change
from (zero_extend:DI (reg:SI X)) to (subreg:DI (reg:SI X)) is
completely invalid. The final rtl explicitly says that the high
32 bits of the DImode value are unused, which from the PR is
obviously wrong.