[LLVMbugs] [Bug 10287] New: Unnecessary testl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 6 11:30:36 PDT 2011


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

           Summary: Unnecessary testl
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


given

double foobar(double x, int y) {
  unsigned n = y;
  double p = 1;
  while (true) {
    n >>= 1;
    if (n == 0)
      return p;
  }
}

gcc produces:

__Z6foobardi:
shrl    %edi
jne    __Z6foobardi
movsd    0x00000004(%rip),%xmm0
re

clang produces:

__Z6foobardi:
shrl    %edi
testl    %edi,%edi
jne    __Z6foobardi
movsd    0x00000002(%rip),%xmm0
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