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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to