This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14237] New: suboptimal comparison between long and long long
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2004 10:53:29 -0000
- Subject: [Bug optimization/14237] New: suboptimal comparison between long and long long
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
unsigned long long g;
unsigned long
foo (unsigned long a)
{
return (a >= g) ? 1 : 0;
}
turns into
foo:
pushl %esi ; we wouldn't need this if %esi were untouched
movl g+4, %ecx
xorl %esi, %esi
pushl %ebx
cmpl %ecx, %esi ; we could use "testl" here because %esi == 0
movl 12(%esp), %ebx
movl $1, %eax
movl g, %edx
jb .L3
cmpl %edx, %ebx
jae .L2
.L3:
xorl %eax, %eax
.L2:
popl %ebx
popl %esi
ret
--
Summary: suboptimal comparison between long and long long
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14237