public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112356] New: `x == MIN & x > y` is not optimized to 0 if x was casted to signed from unsigned
@ 2023-11-02 20:53 pinskia at gcc dot gnu.org
  2023-11-02 20:53 ` [Bug tree-optimization/112356] " pinskia at gcc dot gnu.org
  2023-11-02 21:00 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-02 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112356
           Summary: `x == MIN & x > y` is not optimized to 0 if x was
                    casted to signed from unsigned
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: 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: ---

Take:
```
#include <limits.h>

signed f2_1( unsigned x,  signed y)
{
   signed xs = x;
   signed t = x == INT_MIN;
   signed t1 = xs > y;
  return t & t1;
}
```

This is not optimized to 0.

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

end of thread, other threads:[~2023-11-02 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 20:53 [Bug tree-optimization/112356] New: `x == MIN & x > y` is not optimized to 0 if x was casted to signed from unsigned pinskia at gcc dot gnu.org
2023-11-02 20:53 ` [Bug tree-optimization/112356] " pinskia at gcc dot gnu.org
2023-11-02 21:00 ` pinskia 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).