http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56175
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-21 13:44:09 UTC --- For the real testcase I see .L2: shrw %ax movl %edi, %edx subb $1, %dl movl %edx, %edi je .L9 .L4: movl %ecx, %esi movl %eax, %ebx andl $1, %esi andl $1, %ebx shrb %cl movl %esi, %edx cmpb %bl, %dl je .L2 thus andl $1, %esi andl $1, %ebx cmpb %bl, %dl for t = (u8)((x & 1) ^ ((u8)y & 1)); if (t == 1) and with disabling the forwprop transformation: .L2: shrw %ax subb $1, %dl je .L9 .L4: movl %ecx, %ebx shrb %cl xorl %eax, %ebx andl $1, %ebx je .L2 to confirm the issue again. There is one less used register and the zero-flag use by the conditional jump. The following testcase is too simple to be not optimized anyway at the RTL level but it may serve as a testcase for forwprop. void bar (void); unsigned short foo (unsigned char x, unsigned short y) { unsigned char t = (unsigned char)((x & 1) ^ ((unsigned char)y & 1)); if (t == 1) bar (); return y; }