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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-05-18

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. GCC does have some code that handles some of this in phiopt but not
in a generic way.

Jump threading can handle:
```
int src1(unsigned a, unsigned b, int c) {
    unsigned phi;
    if(c) {
        dummy();
        phi = a < 5 ? a : 5;
    } else {
        phi = b;
    }
    if (phi < 6)
      dummy();
}
```

But not:
```
int src(unsigned a, unsigned b, int c) {
    unsigned phi;
    if(c) {
        dummy();
        phi = a < 5 ? a : 5;
    } else {
        phi = b;
    }
    return (phi < 6);
     dummy();
}
```

Reply via email to