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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-11-19
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note also we should be optimize this at the gimple level too:
```
unsigned f1(unsigned a, unsigned *c)
{
  return __builtin_add_overflow(a,-a,c);
}
```

into:
```
unsigned f1(unsigned a, unsigned *c)
{
  *c = 0;
  return a != 0;
}
```

Or the gimple level format:
```
  _1 = -a_4(D);
  _5 = .ADD_OVERFLOW (_1, a_4(D));
  _2 = REALPART_EXPR <_5>;
  *c_7(D) = _2;
  _3 = IMAGPART_EXPR <_5>;
```
Into:
```
_tmp = a != 0;
_5 = COMPLEX_EXPR<0, _tmp>;
...
```

Mine.

Reply via email to