[llvm-bugs] [Bug 25672] New: [powerpc64] Unnecessary stack frame when using sqrtf()

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 29 15:48:03 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25672

            Bug ID: 25672
           Summary: [powerpc64] Unnecessary stack frame when using sqrtf()
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: anton at samba.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following testcase:

extern float sqrtf (float);

float t3(float a)
{
  return sqrtf(a);
}

does not allocate a stack frame on gcc:

# gcc -S -O3 -mcpu=power8 -ffast-math test.c
# cat test.s

t3:
    fsqrts 1,1
    blr


But does on clang:

# clang -S -O3 -mcpu=power8 -ffast-math -mrecip=none test.c
# cat test.s

t3:                                     # @t3
.Lfunc_begin2:
# BB#0:                                 # %entry
    stw 31, -4(1)
    stwu 1, -16(1)
    mr 31, 1
    xssqrtsp 1, 1
    addi 1, 1, 16
    lwz 31, -4(1)
    blr

I added -mrecip=none to keep the output simple, but it reproduces without it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151129/aefc4f30/attachment.html>


More information about the llvm-bugs mailing list