https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83123
--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> --- In the first case (with the extend to SImode) the extend is combined with the AND, to an AND in SImode. After that, the 3-insn combination of the two shifts with the AND is something combine knows how to split. In the second case this of course does not happen.