public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113379] New: `MIN<a,b> == MAX<a,b>` should be optimzed to `a == b`
@ 2024-01-13 16:53 pinskia at gcc dot gnu.org
  2024-01-13 16:58 ` [Bug tree-optimization/113379] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-13 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113379
           Summary: `MIN<a,b> == MAX<a,b>` should be optimzed to `a == b`
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int f(int a, int b)
{
        int c = a > b ? a : b;
        int d = a < b ? a : b;
        return c == d;
}
```

This should be optimized to `a == b;`

Likewise for the `!=` case too.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-15 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-13 16:53 [Bug tree-optimization/113379] New: `MIN<a,b> == MAX<a,b>` should be optimzed to `a == b` pinskia at gcc dot gnu.org
2024-01-13 16:58 ` [Bug tree-optimization/113379] " pinskia at gcc dot gnu.org
2024-01-15  8:36 ` rguenth at gcc dot gnu.org
2024-01-15 16:44 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).