https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109907
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Georg-Johann Lay from comment #6) > Quite impressive improvement. Maybe the last step can be achieved with a > combiner pattern that combines extzv with a bit flip. > > One problem is usually that there is no canonical form (sometimes > zero_extract, sometimes shift+and, sometimes with subregs for extraction or > paradoxical subregs for wider types, different behaviour for MSB, etc.). Right, In this case combine tries: (set (reg/i:QI 24 r24) (zero_extract:QI (xor:QI (reg:QI 54) (const_int 64 [0x40])) (const_int 1 [0x1]) (const_int 6 [0x6]))) Which puts the xor inside the zero_extract even but I think you could handle that once my patch set goes in.