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

            Bug ID: 85382
           Summary: code compiled with fno-builtin uses builtin
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: konstantin.vladimirov at gmail dot com
  Target Milestone: ---

Minimized reproduction:

double a, b;

void f() {
  a = b * b * (628972 + b - 628972);
}

Compile with:

gcc -msse4 -ffast-math -Os -S minimize.c -fno-builtin -ffreestanding

Remove fast-math to kill reproduction.

Assembler:

f:
.LFB0:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        movl    $3, %edi
        movsd   b(%rip), %xmm0
        call    __powidf2
        movsd   %xmm0, a(%rip)
        popq    %rax
        .cfi_def_cfa_offset 8
        ret

Compiler version:

Target: x86_64-suse-linux
Thread model: posix
gcc version 7.2.0 (GCC)

Reply via email to