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).

Reply via email to