------- Comment #1 from rguenth at gcc dot gnu dot org 2006-11-09 22:07 ------- If the fold transformation is disabled we can force lim to move the shifts out of the loop by specifying --param lim-expensive=1 (it considers the shifts being of cost one). The default of the param is 20 though.
PRE thinks the shifts are loop induction variables, so it doesn't move them out of the loop. With the above "fixes" we get .L4: movl (%edi,%ecx,4), %edx testl %edx, %ebx je .L5 testl %edx, %esi je .L5 xorl %eax, %edx movl %edx, (%edi,%ecx,4) .p2align 4,,7 .L5: addl $1, %ecx cmpl 24(%ebp), %ecx jne .L4 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29789