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

            Bug ID: 122325
           Summary: [16 Regression] -ffast-math (-Ofast) no longer turns
                    on -fcx-limited-range
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

As I reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60779#c9.
`-O2 -ffast-math` and `-Ofast` no longer turns on -fcx-limited-range.
Simple testcase:
```
_Complex  double f(_Complex double a, _Complex double b)
{
  return a/b;
}
```

On the trunk with -Ofast GCC produces just:
```
"f":
.LFB0:
        .cfi_startproc
        jmp     "__divdc3"
        .cfi_endproc
```

But if we add -fcx-limited-range we get:
```

"f":
.LFB0:
        .cfi_startproc
        movapd  xmm5, xmm0
        movapd  xmm4, xmm3
        movapd  xmm0, xmm2
        mulsd   xmm0, xmm2
        movapd  xmm6, xmm1
        mulsd   xmm4, xmm3
        mulsd   xmm6, xmm3
        mulsd   xmm1, xmm2
        addsd   xmm4, xmm0
        movapd  xmm0, xmm5
        mulsd   xmm0, xmm2
        mulsd   xmm5, xmm3
        addsd   xmm0, xmm6
        subsd   xmm1, xmm5
        divsd   xmm0, xmm4
        divsd   xmm1, xmm4
        ret
```

GCC 15.2.0 and before didn't need the additional -fcx-limited-range option for
-Ofast.

Reply via email to