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

            Bug ID: 110965
           Summary: missing combining if ranges due to cast differences
           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: ---

Take:
```
int f(long long l)
{
  int t =  (int)l;
  if (t == 1 || t == 2)
    return true;
  if (t == 3)
    return true;

  return false;
}

int f1(long long l)
{
  unsigned t =  (unsigned)l;
  if (t == 1 || t == 2)
    return true;
  if (t == 3)
    return true;
  return false;
}
```

f and f1 should produce the same code but currently does not.

Reply via email to