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

            Bug ID: 123027
           Summary: [14/15/16 Regression] minss is not used with
                    -ffinite-math-only
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

FW from:
https://www.reddit.com/r/gcc/comments/1pdjjri/strange_behaviour_of_ffinitemathonly_in_gcc_14/

```
float min(float a, float b) {
    return a < b ? a : b;
}
```

Compiles down to:
        minss   xmm0, xmm1

Unless you use -ffinite-math-only (and with -ffast-math it works again) and
then it does something more complex.

It seems that the backend is not able to handle:
```
_4 = a_1(D) < b_2(D);
_3 = _4 ? a_1(D) : b_2(D);
```
While does handle the non-cond-expr one in ce1 just fine.

Maybe related to PR 106952; especially
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106952#c5 .

Reply via email to