http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25290
Marc Glisse <glisse at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glisse at gcc dot gnu.org --- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> --- I assume it would help with this? int f(int a,int b){ return (a<0)&(b<0); } int g(int a,int b){ return (a<0)?(b<0):0; } int h(int a,int b){ if (a<0) return (b<0); return 0; } where (on x86) we turn g into f, but we don't notice that h is the same. In asm, that is: movl %esi, %eax andl %edi, %eax shrl $31, %eax ((a<0)&(b<0) is later optimized to (a&b)<0) vs shrl $31, %esi xorl %eax, %eax testl %edi, %edi cmovs %esi, %eax