public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110134] New: [10/11/12/13/14 Regression] (-unsigned1) != CST is not optimized to unsigned1 != CST at the gimple level
@ 2023-06-06  1:50 pinskia at gcc dot gnu.org
  2023-06-06  1:59 ` [Bug tree-optimization/110134] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-06  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110134
           Summary: [10/11/12/13/14 Regression] (-unsigned1) != CST is not
                    optimized to unsigned1 != CST at the gimple level
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
bool f1(int  a)
{
  unsigned t = a < 10;
  t = -t;
  return t != 0;
}

bool f2(int  a)
{
  signed t = a < 10;
  t = -t;
  return t != 0;
}
```

These should both optimize to just `a >= 9` in forwprop1 .
Both of these were working in GCC 5.
Starting GCC 6, neither was done and then in GCC 8, f2 was handled.

I noticed this while looking at PR 110131 (doing this does not fix that
though).

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

end of thread, other threads:[~2023-06-07  3:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06  1:50 [Bug tree-optimization/110134] New: [10/11/12/13/14 Regression] (-unsigned1) != CST is not optimized to unsigned1 != CST at the gimple level pinskia at gcc dot gnu.org
2023-06-06  1:59 ` [Bug tree-optimization/110134] " pinskia at gcc dot gnu.org
2023-06-06  2:08 ` pinskia at gcc dot gnu.org
2023-06-06  2:50 ` pinskia at gcc dot gnu.org
2023-06-06  8:36 ` rguenth at gcc dot gnu.org
2023-06-06 21:11 ` pinskia at gcc dot gnu.org
2023-06-07  2:59 ` cvs-commit at gcc dot gnu.org
2023-06-07  3:02 ` 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).