https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050
--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Before ext-dce:
(insn 420 419 421 43 (set (reg:SI 423 [ _144 ])
(truncate:SI (reg:DI 304 [ ivtmp.55 ]))) 203 {truncdisi2}
(nil))
(insn 421 420 422 43 (set (reg:DI 523 [ i ])
(sign_extend:DI (reg:SI 423 [ _144 ]))) 238 {extendsidi2}
"../../gcc/gcc/genhooks.cc":198:8 323 {*movsi_internal}
(insn 439 436 440 45 (set (reg:SI 430 [ shp_91->pos ])
(mem:SI (plus:DI (reg/v/f:DI 240 [ shp ])
(const_int 8 [0x8])) [5 shp_91->pos+0 S4 A64]))
"../../gcc/gcc/genhooks.cc":198:8 323 {*movsi_internal}
(nil))
(insn 440 439 441 45 (set (reg:SI 431 [ i ])
(subreg/u:SI (reg:DI 523 [ i ]) 0)) "../../gcc/gcc/genhooks.cc":198:8
323 {*movsi_internal}
(nil))
(jump_insn 441 440 442 45 (set (pc)
(if_then_else (eq (reg:SI 430 [ shp_91->pos ])
(reg:SI 431 [ i ]))
(label_ref 448)
(pc))) "../../gcc/gcc/genhooks.cc":198:8 487 {*branch_equalitysi}
(expr_list:REG_DEAD (reg:SI 431 [ i ])
(expr_list:REG_DEAD (reg:SI 430 [ shp_91->pos ])
(int_list:REG_BR_PROB 548896828 (nil))))
-> 448)
And ext-dce rewrites the sign_extend in insn 421 as subreg. I don't even know
if this is correct before ext-dce...