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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
gimple-ssa-strength-reduction definitely should be improved to handle this case
where it should understand that (a+CSTWITHLASTBITSET)*2 can be done as
a*2+NEWCST if the type can wrap. Only can do that if wrapping rather than if
overflow is undefined.

For a non-signed case which should be handled:
```
unsigned a, b, c;
void test() {
    a = c + c;
    c += -2147483648u;
    b = c + c;
}
```

Maybe I will look at this for GCC 15. It might improve other code ...

Reply via email to