https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67506
--- Comment #2 from Kazumoto Kojima <kkojima at gcc dot gnu.org> --- Created attachment 36309 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36309&action=edit reduced test case It looks that some problem happens in tstsi_t splitter. The insns before splitting are: (insn 124 123 125 13 (set (reg:HI 262 [ *_48 ]) (zero_extend:HI (reg:QI 263 [ *_48 ]))) tfoo.c:41 223 {zero_extendqihi2} (expr_list:REG_DEAD (reg:QI 263 [ *_48 ]) (nil))) (note 125 124 126 13 NOTE_INSN_DELETED) (insn 126 125 127 13 (set (reg:SI 197 [ *_48 ]) (zero_extend:SI (reg:HI 262 [ *_48 ]))) tfoo.c:42 220 {*zero_extendhisi2_compact} (nil)) (insn 127 126 128 13 (set (reg:SI 147 t) (zero_extract:SI (subreg:SI (reg:HI 262 [ *_48 ]) 0) (const_int 1 [0x1]) (const_int 7 [0x7]))) tfoo.c:42 516 {*zero_extract_0} (nil)) and the last insn is splitted into (insn 478 126 479 16 (set (reg:SI 147 t) (eq:SI (and:SI (subreg:SI (reg:HI 262 [ *_48 ]) 0) (const_int 128 [0x80])) (const_int 0 [0]))) tfoo.c:42 -1 (nil)) with *zero_extract_0 splitter. Then it seems that tstsi_t splitter replaces (subreg:SI (reg:HI 262 [ *_48 ]) 0) with (reg:HI 262 [ *_48 ]) as the result of eop0.use_as_extended_reg and we got (insn 480 126 481 16 (set (reg:SI 147 t) (eq:SI (and:SI (reg:HI 262 [ *_48 ]) (const_int 128 [0x80])) (const_int 0 [0]))) tfoo.c:42 -1 (nil)) Oleg, could you please look at this?