This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19778] Unnecessary jumps for comparisons
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2005 18:19:45 -0000
- Subject: [Bug tree-optimization/19778] Unnecessary jumps for comparisons
- References: <20050203110542.19778.falk@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-04 18:19 -------
I think this is fixed on the mainline, for x86, in 4.0.0 we get:
movl 4(%esp), %edx
testl %edx, %edx
je .L2
leal -1(%edx), %eax
xorl %ecx, %ecx
testl %eax, %edx
jne .L5
.L2:
movl $1, %ecx
.L5:
movl %ecx, %eax
ret
But on the mainline we get:
movl 4(%esp), %edx
movl $1, %eax
testl %edx, %edx
je .L4
leal -1(%edx), %eax
testl %eax, %edx
sete %al
movzbl %al, %eax
.L4:
ret
--
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|alphaev68-unknown-linux-gnu |
GCC host triplet|alphaev68-unknown-linux-gnu |
GCC target triplet|alphaev68-unknown-linux-gnu |alphaev68-*-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19778