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

            Bug ID: 110293
           Summary: Some `A CMP (A NEEQ 0)` is not simplified in some
                    cases
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

The full set is:
`x != (typeof x)(x == 0)` is always true (PR 110278)
`x == (typeof x)(x == 0)` is always false.
`x == (typeof x)(x != 0)` is `(unsigned_type)x <= 1`
`x != (typeof x)(x != 0)` is `(unsigned_type)x > 1`


`uns < (typeof uns)(uns != 0)` is always false (PR 110278)
`uns >= (typeof uns)(uns != 0)` is always true
`uns <= (typeof uns)(uns != 0)` is `uns <= 1`
`uns > (typeof uns)(uns != 0)` is `uns > 1`

Reply via email to