This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc

------- Additional Comments From kazu at cs dot umass dot edu  2005-04-14 15:51 -------
Before VRP (even before ASSERT_EXPR insertion), we have

  const void * r;
  unsigned int D.1157;
  void * D.1156;


  if (r_3 >= D.1157_5) goto <L0>; else goto <L5>;

Note that we already have a type-mismatched comparison - an integer
v.s. a pointer.

tree-vrp.c:maybe_add_assert_expr inserts the following ASSERT_EXPR in
the "else" branch of the "if" statement.

  r_14 = ASSERT_EXPR <r_3, r_3 < D.1157_5>;

Eventually the propagation engine visits this ASSERT_EXPR with a call
tree like so.

          extract_range_from_assert (ASSERT_EXPR <r_3, r_3 < D.1157_5>)
            value_ranges_intersect_p ([D.1156_2, D.1156_2], [0, D.1157_5 - 1])
              value_inside_range (D.1157_5 - 1, [D.1156_2, D.1156_2])
                compare_values (D.1157_5 - 1, D.1156_2)

compare_values does some limited symbolic comparisons.  In this case,
it checks whether D.1156_2 == INF so that if that's the case, we can
deduce that

  D.1157_5 - 1 < D.1156_2

But we cannot compute TYPE_MAX_VALUE (TREE_TYPE (D.1156_2)) because
D.1156_2 is of a pointer type, causing the ICE.

The root cause of the problem is that we have a type-mismatched


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]