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

            Bug ID: 111276
           Summary: rewrite_to_defined_overflow rewrites already defined
                    code
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: compile-time-hog, internal-improvement
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int bcmp_2(char *a, char *b, unsigned s) {
    if (s < 16) {
        if (s >= 8)
                return 1;

    }
    return 0;
}
```
ifcombine produces:
```
rewriting stmt with undefined signed overflow _4 = s_2(D) + 4294967288;
  unsigned intD.9 s_2(D) = sD.3394;
...
  _5 = s_2(D) + 4294967288;
  _4 = (unsigned intD.9) _5;
  if (_4 <= 7)
```

Seems like we don't need to do a rewrite in this case ...

Reply via email to