This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/46200] [4.6 Regression] optimization regression in simple pointer loop
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 28 Oct 2010 17:53:54 +0000
- Subject: [Bug target/46200] [4.6 Regression] optimization regression in simple pointer loop
- Auto-submitted: auto-generated
- References: <bug-46200-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46200
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xinliangli at gmail dot com
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-28 17:53:50 UTC ---
It is caused by revision 162653:
http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg01007.html
With -o2, revision 162651 gave:
test:
.LFB0:
.cfi_startproc
cmpq %rsi, %rdi
je .L1
movslq %edx, %rdx
salq $2, %rdx
.p2align 4,,10
.p2align 3
.L3:
movl $1, (%rdi)
addq %rdx, %rdi
cmpq %rdi, %rsi
jne .L3
.L1:
rep
ret
.cfi_endproc
Revision 162653 gave
test:
.LFB0:
.cfi_startproc
cmpq %rsi, %rdi
je .L1
movslq %edx, %rdx
salq $2, %rdx
movq %rdx, %rcx
addq %rdx, %rdi
negq %rcx
.p2align 4,,10
.p2align 3
.L3:
movl $1, (%rdi,%rcx)
addq %rdx, %rdi
movq %rdi, %rax
subq %rdx, %rax
cmpq %rax, %rsi
jne .L3
.L1:
rep
ret