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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |85316
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2026-01-08
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
n_38 = 1 << l_6(D);

When visited with a range for l_6(D) of [4, INF];
Should produce a range of `[-INF,-INF], [1<<4, INF]`


So a reduced testcase:
```
int f(int l)
{
 // if (l >= (int)sizeof(int)*8)  return 0;
  if (l <= 4)  return 0;
  int t = 1 << l;
  return (t == 0) + t;
}
```

This should reduce down to `if (l > 4) return 1 << l; else return 0;`

We handle it correctly for `1u`.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases

Reply via email to