https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95966

            Bug ID: 95966
           Summary: soft float operations are not tail called
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

i'd expect this to be a tail call into the soft float add
operation on soft float targets:

fp_t foo(fp_t a, fp_t b)
{
    return a + b;
}

e.g. on x86 with 'typedef __float128 fp_t' the generated code is

foo:
        sub     rsp, 8
        call    __addtf3
        add     rsp, 8
        ret

on aarch64 with 'typedef long double fp_t' the generated code is

foo:
        stp     x29, x30, [sp, -16]!
        mov     x29, sp
        bl      __addtf3
        ldp     x29, x30, [sp], 16
        ret

i see similar code on other softfp targets.

Reply via email to