[Bug tree-optimization/123300] [14/15/16 Regression] Adding [[assume((1<<i) > 0)]] generates an infinite loop

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 25 22:30:20 GMT 2025


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.4
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
loop_done removes the loop exit because the ranges say it is always true:
```
  # RANGE [irange] int [0, 2147483645] MASK 0x7fffffff VALUE 0x0
  i_6 = i_16 + -1;
  if (i_6 != -1)
    goto <bb 8>; [89.00%]
  else
    goto <bb 9>; [11.00%]
```

Which IVOPTs changes from:
```
  # RANGE [irange] int [0, 2147483645] MASK 0x7fffffff VALUE 0x0
  i_6 = i_16 + -1;
  if (i_16 > 0)

```

Maybe it is the range which is wrong in the first place.


More information about the Gcc-bugs mailing list