http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52267

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

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

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-03-22 
12:28:54 UTC ---
(In reply to comment #5)

> Added:
>     trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp66.c

In that test case there is:

int svals[] = {
  ...
  0x3cc0, // = 15552
  ...
};

and then in f2() this runs on abort. The if tests for the 3 upper bits in s
which are not all clear for 0x3cc0 if sizeof(int) = 2.

Thus the else part is entered where there is no test for 0x3cc0 or 15552 and
then abort is entered.

void
f2 (int s)
{
  if ((s & (7U << (BITSM1 - 2))) == 0)
    {
      if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
      || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f || s == 1
      || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
    return;
    }
  else
    {
      if (s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
      || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
      || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
      || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
      || s == (-0x4000 << BITSH) + 1 || s == -1 || s == -15 || s == -15550
      || s == -15552 || s == (0x7000 << BITSH) - 1
      || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
      || s == -__INT_MAX__ - 1 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
      || s == -5 || s == -63 || s == -64 || s == -65
      || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
      || s == -8193 || s == -8250 || s == -8255 || s == -8256
      || s == -8257 || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
    return;

I just rediced the test case to find this thinko; I don't know if there are
more because of the sheer amount of values in this program.

Reply via email to