[Bug optimization/14237] New: suboptimal comparison between long and long long
kazu at cs dot umass dot edu
gcc-bugzilla@gcc.gnu.org
Sat Feb 21 10:53:00 GMT 2004
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
More information about the Gcc-bugs
mailing list