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

            Bug ID: 111348
           Summary: `(a CMP b) ? minmax<a, c> : minmax<b, c>` pattern
                    missing :c on CMP
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: internal-improvement, missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

```
(for minmax (min max)
 (for cmp (lt le gt ge ne)
  (simplify
   (cond (cmp @1 @3) (minmax:c @1 @4) (minmax:c @2 @4))
```

Is missing :c on cmp
because we could have
(@3 < @1) ? min(@1, @4) : min(@2, @4)

Which should match for and provide the same as `@1 > @3 ? min(@1, @4) : min(@2,
@4)`

Reply via email to