https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111376
--- Comment #6 from Siarhei Volkau <lis8215 at gmail dot com> --- Well, it is work mostly well. However, it still has issues, addressed in my patch: 1) Doesn't work for -Os : highly likely costing issue. 2) Breaks condmoves, as mine does. I have no idea how to avoid that though. 3) Overlaps preferable ANDI+BEQ/BNE cases: (as it don't break condmoves) I think it will be okay whether fixed 1 and 3. PS: tested by applying the patch on GCC 11, will try with upstream this weekend.