------- Comment #2 from rguenth at gcc dot gnu dot org 2007-03-19 16:47 ------- On x86 different addressing modes and induction variables are used. Good:
.L2: movq %r12, 8(%rsp) addl $1, %ebp movsd 8(%rsp), %xmm0 call Square movsd %xmm0, (%rbx) addq $8, %rbx cmpl $50000000, %ebp jne .L2 bad: .L2: movq %r12, 8(%rsp) movsd 8(%rsp), %xmm0 call Square movsd %xmm0, (%rbp,%rbx,8) addq $1, %rbx cmpq $50000000, %rbx jne .L2 this is because we retain the complex expression until the last DOM run after loop optimization (for 4.1.2 at least). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31263