https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53988
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Last reconfirmed| |2014-12-29 Resolution|FIXED |--- Ever confirmed|0 |1 --- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> --- The change in r192982 results in wrong code: int test (short x, short* y, int z, int w) { return x & y[0] ? z : w; } mov.w @r5,r1 // sign extended y[0], bits[31:16] = 1 tst r4,r1 // r4 bits [31:16] undefined bf .L5 mov r7,r0 rts nop .align 1 .L5: rts mov r6,r0 The *tst<mode>_t_zero insns blindly accept subregs. They have to check whether both operands have been sign extended or at least one of them has been zero extended (to mask out the unwanted high bits).