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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to