------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-01 05:57 ------- Hmm, maybe gcc should be able to optimize the following RTL better when combining them (if gcc does combine them): (insn 19 18 20 0 (set (reg:CCZ 17 flags) (compare:CCZ (zero_extract:SI (subreg:DI (reg:QI 61 [+5 ]) 0) (const_int 1 [0x1]) (const_int 0 [0x0])) (const_int 0 [0x0]))) 283 {*testqi_ext_3} (insn_list:REG_DEP_TRUE 16 (nil)) (nil)) ... (insn 23 22 24 0 (set (reg:QI 68) (ne:QI (reg:CCZ 17 flags) (const_int 0 [0x0]))) 480 {*setcc_1} (insn_list:REG_DEP_TRUE 19 (nil)) (expr_list:REG_DEAD (reg:CC 17 flags) (nil)))
And we should get: (set (reg:QI 68) (zero_extract:SI (subreg:DI (reg:QI 61 [+5 ]) 0) (const_int 1 [0x1]) (const_int 0 [0x0]))) because we know that what the compare compares against can only be 1 or 0 as it is a zero_extract of size 1. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19331