[LLVMbugs] [Bug 5438] New: Small example where gcc produces better code

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 9 02:28:24 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5438

           Summary: Small example where gcc produces better code
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


>From the Felix von Leitner talk:

int bar(int a,int b) {
  return (a<0) == (b<0);
}

gcc-4.4 gives (x86-64):

        movl    %edi, %eax
        notl    %eax
        xorl    %esi, %eax
        shrl    $31, %eax
        ret

llvm-gcc gives:

        testl   %edi, %edi
        setns   %al
        testl   %esi, %esi
        sets    %cl
        xorb    %al, %cl
        movzbl  %cl, %eax
        ret


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list