This is the mail archive of the gcc-bugs@gcc.gnu.org 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/39870] VRP can't see through cast to unsigned



------- Comment #13 from rguenth at gcc dot gnu dot org  2009-04-24 16:41 -------
<bb 4>:
  x_11 = ASSERT_EXPR <x_13, x_13 <= 10>;
  x.0_3 = (unsigned int) x_11;
  D.1241_4 = x.0_3 + 0x0ffffffff;
  if (D.1241_4 > 9)

x.0_3: [1, 10]
D.1241_4: [0, +INF]

so it's only only the usual case of not handling overflow properly during
evaluation.  [1, 10] + -1U is [0(overflow), 9(overflow)] for VRP and so
it falls back to VARYING.  To fix this we need to know the direction
of overflow.  See also PR30318.

The patch I was refering to made VRP able to derive a range from
the D.1241_4 > 9 test.


-- 


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


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