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

            Bug ID: 114725
           Summary: Missed optimization: more precise range for and
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Godbolt link: https://godbolt.org/z/vTb1Y5b39

```
bool src(int offset) {
    if(offset > 128) {
        return 0;
    } else {
        dummy();
        return (offset & -9) == 258;
    }
}

```
can be folded to:
```
bool tgt(int offset) {
    if(offset > 128) {
        return 0;
    } else {
        dummy();
        return 0;
    }
}
```

Reply via email to