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

            Bug ID: 126762
           Summary: missing usatadd due to pre
           Product: gcc
           Version: 17.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:
```
unsigned f(unsigned a, unsigned cst)
{
    unsigned add;
    if (__builtin_add_overflow (a, cst, &add))
      add = -1u;
    add -= 4;
    return add;
}
```

This should be recognized as `usatadd(a,cst) - 4`. But it is not because we
recongize sat add late after pre happens.

Reply via email to