public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14237] New: suboptimal comparison between long and long long
@ 2004-02-21 10:53 kazu at cs dot umass dot edu
  2004-02-23  1:23 ` [Bug optimization/14237] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-02-21 10:53 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-03 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-21 10:53 [Bug optimization/14237] New: suboptimal comparison between long and long long kazu at cs dot umass dot edu
2004-02-23  1:23 ` [Bug optimization/14237] " pinskia at gcc dot gnu dot org
2004-02-23  1:36 ` kazu at cs dot umass dot edu
2004-02-29  4:10 ` kazu at cs dot umass dot edu
2004-11-03 18:14 ` [Bug rtl-optimization/14237] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).