[LLVMbugs] [Bug 10287] New: Unnecessary testl

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


           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


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

gcc produces:

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

clang produces:

shrl    %edi
testl    %edi,%edi
jne    __Z6foobardi
movsd    0x00000002(%rip),%xmm0

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