[Bug tree-optimization/99296] [11 Regression] ICE:in irange_set_anti_range, at value-range.cc:205 with "-Os -fno-toplevel-reorder -fno-tree-bit-ccp" since r11-5105-ga5f9c27bfc441722

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 17 10:03:22 GMT 2021


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
signed 1 bit precision are always a nightmare to deal with.
      wide_int lim1 = wi::sub (w_min, 1, sign, &ovf);
      gcc_checking_assert (ovf != wi::OVF_OVERFLOW);
1 is not really representable in that type, which is why I think we're getting
the overflow.  So I think we need to use
      wide_int lim1
        = !sign && w_min.get_precision () == 1
          ? wi::add (w_min, -1, sign, &ovf)
          : wi::sub (w_min, 1, sign, &ovf);
instead.
And in the other spot in the same function the other way around (when it is
called on signed precision 1 -1, -1.  One can't wi::add (w_max, 1, sign, &ovf)
either, needs wi::sub (w_max, -1, sign, &ovf).


More information about the Gcc-bugs mailing list