[Bug tree-optimization/126695] Drop a redundant nested fmin or fmax

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126695

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-08-07
             Status|UNCONFIRMED                 |NEW
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
We handle MIN/MAX_EXPR here:
```
(for minmax (min max)
     maxmin (max min)
 (simplify
  (minmax @0 @0)
  @0)
/* max(max(x,y),x) -> max(x,y)  */
 (simplify
  (minmax:c (minmax:c@2 @0 @1) @0)
  @2)

```

Should be simple to add a similar for FMIN_ALL/FMAX_ALL here like what is done
for min/max(a,a):
```
(for minmax (FMIN_ALL FMAX_ALL)
 (simplify
  (minmax @0 @0)
  (if (!tree_expr_maybe_signaling_nan_p (@0))
    @0)))

```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.