------- Comment #1 from rguenth at gcc dot gnu dot org  2007-05-16 10:18 -------
Confirmed.  A regression with -O2 -ftrapv.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000830f6e in compare_values (val1=0x0, val2=0x2ac511f0e9f0)
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/tree-vrp.c:435
435       gcc_assert (POINTER_TYPE_P (TREE_TYPE (val1))

we extract from unary

-xD.1609_3

with a value range

~[-INF, -2147483648]  EQUIVALENCES: { x_1 } (1 elements)

but of course,

  if (code == NEGATE_EXPR
      && !TYPE_UNSIGNED (TREE_TYPE (expr)))
    {
      /* NEGATE_EXPR flips the range around.  */
      min = (vr0.max == TYPE_MAX_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
             ? TYPE_MIN_VALUE (TREE_TYPE (expr))
             : fold_unary_to_constant (code, TREE_TYPE (expr), vr0.max);

      max = (vr0.min == TYPE_MIN_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
             ? TYPE_MAX_VALUE (TREE_TYPE (expr))
             : fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
    }

is bogus.  And this is a dup of PR26998.

*** This bug has been marked as a duplicate of 26998 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.1.0 4.1.2
      Known to work|                            |4.2.0
         Resolution|                            |DUPLICATE
            Summary|ICE with -O -ftrapv -ftree- |[4.1 Regression] ICE with -O
                   |vrp on negation after       |-ftrapv -ftree-vrp on
                   |comparison to INT_MIN       |negation after comparison to
                   |                            |INT_MIN
   Target Milestone|---                         |4.1.3


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

Reply via email to