This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24669] Loop index variable has offset of 1
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2005 09:20:48 -0000
- Subject: [Bug tree-optimization/24669] Loop index variable has offset of 1
- References: <bug-24669-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from uros at kss-loka dot si 2005-11-04 09:20 -------
-fno-ivopts produces:
movl 16(%esp), %edi
movl 20(%esp), %esi
xorl %ebx, %ebx
movl $4, %ecx <<< index starts with 1
.L2:
leal (%ebx,%ebx), %edx
movl (%edi,%edx,2), %eax
movl %eax, (%esi,%edx,2)
addl $1, %ebx
subl $1, %ecx <<< no compare!
jne .L2
Hm, why isn't produced something like:
movl 8(%esp), %ebx
movl 12(%esp), %ecx
movl $4, %edx
.L2:
movl (%ebx,%edx,4), %eax
movl %eax, (%ecx,%edx,4)
dec %edx
jne .L2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24669