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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org
   Target Milestone|12.4                        |14.0

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So I have a VRP patch which gets us to:
```
  # RANGE [irange] int [-32768, -1][2, 32767]
  _34 = (intD.6) _13;
  # RANGE [irange] unsigned int [2, 32767][4294934528, +INF]
  _30 = (unsigned int) _13;
  _22 = _30 == 4294967295;
  # RANGE [irange] int [-32768, 0][2, 32767]
  _35 = _22 ? _34 : 0;

```

Which is:
`(unsigned int)_13 == 4294967295 ? (intD.6) _13 : 0`

or rather `_13 == -1 ? -1 : 0`
or rather just `-(_13 == -1)`


  if (_35 != 5)

And obvious [-1,0] != 5.

So maybe:
```
(simplify
 (cond
  (eq:c@3 (convert1? @0) INTEGER_CST@1)
  (convert2? @0)
  INTEGER_CST@2
 )
 (if (INTEGRAL_TYPE_P (type))
  (cond @3 (convert @1) @2)
 )
)
```
There might be a few more checks dealing with @1 though.

Reply via email to