Andrew Pinski <pins...@gmail.com> writes: > On Fri, Apr 1, 2011 at 8:57 PM, Alex <cirru...@uol.com.br> wrote: >> If I understood correct, gcc could replace insns 5, 7, 8 and 9 by the insn >> defined as "*and<mode>_2", but it seems "combine" did not tried that. > > Yes you missed that combine in GCC only acts on 3 insns at a time. > Though that has changed in GCC 4.6 and above so try to look see if the > trunk does this optimization.
FYI, gcc-2.95.4 with -O3 -fomit-frame-pointer -march=pentiumpro generates the following: func1: movl a,%eax andl b,%eax movl %eax,a je .L3 movl d,%eax movl %eax,c .L3: ret