https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9760
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Still happens on the trunk. Note armv7-a produces reasonable code though as it uses ubfx which is new for armv7-a: push {r4, lr} mov r4, r0 movs r0, #8 lsrs r1, r4, #24 bl func ubfx r1, r4, #16, #8 movs r0, #8 bl func ubfx r1, r4, #8, #8 movs r0, #8 pop {r4, lr} b func