[LLVMbugs] [Bug 3219] New: fails to inline sqrt

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Dec 15 22:23:04 PST 2008


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

           Summary: fails to inline sqrt
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


On this program:

  #include <math.h>
  double foo(double X) { return sqrt(X); }

GCC will inline the fast path (non-negative X) and produce this:

foo:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        fldl    8(%ebp)
        fld     %st(0)
        fsqrt
        fucomi  %st(0), %st
        jp      .L7
        je      .L8
        fstp    %st(0)
        jmp     .L5
.L7:
        fstp    %st(0)
        .p2align 4,,7
        .p2align 3
.L5:
        fstpl   (%esp)
        .p2align 4,,5
        .p2align 3
        call    sqrt
        .p2align 4,,2
        .p2align 3
        jmp     .L2
        .p2align 4,,7
        .p2align 3
.L8:
        fstp    %st(1)
.L2:
        leave
        .p2align 4,,1
        .p2align 3
        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