This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11707] constants not propagated in unrolled loop iterations with a conditional
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2003 14:07:45 -0000
- Subject: [Bug optimization/11707] constants not propagated in unrolled loop iterations with a conditional
- References: <20030729133436.11707.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11707
rguenth at tat dot physik dot uni-tuebingen dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2003-07-29 14:07 -------
This is actually a regression from 2.95.3 (-O2 -funroll-loops):
gcc2_compiled.:
.text
.align 16
.globl foo2
.type foo2,@function
foo2:
pushl %ebp
movl %esp,%ebp
movl $1,%eax
movl %ebp,%esp
popl %ebp
ret
and a regression from 3.3 to which this is a regression from 2.92.3:
.text
.p2align 4,,15
.globl foo2
.type foo2, @function
foo2:
pushl %ebp
movl $1, %eax # a
movl %esp, %ebp
popl %ebp
imull %eax, %eax # a, a
ret
and of course worst for gcc3.4:
.text
.p2align 4,,15
.globl foo2
.type foo2, @function
foo2:
pushl %ebp #
movl $5, %eax #, n
shrl %eax # tmp62
testl %eax, %eax # n
movl %esp, %ebp #,
movl $1, %edx #, a
je .L11 #,
imull %edx, %edx # a, a
.L11:
shrl %eax # n
testl %eax, %eax # n
je .L4 #,
imull %edx, %edx # a, a
.L4:
popl %ebp #
movl %edx, %eax # a, <result>
ret
With gcc3.4 and -fold-unroll-loops we get back to 2.95.3 code:
.text
.p2align 4,,15
.globl foo2
.type foo2, @function
foo2:
pushl %ebp #
movl $1, %eax #, <result>
movl %esp, %ebp #,
popl %ebp #
ret
So can this be targeted at 3.3 and marked as regression? Thanks.