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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #1 from Andrew Macleod <amacleod at redhat dot com> ---
 without DOM, after vrp2 I see:

  <bb 2> [local count: 1073741824]:
  i_4 = *p_3(D);
  i.0_1 = (unsigned int) i_4;
  _6 = i.0_1 > 99999;
  _11 = i.0_1 > 99999;
  _7 = i_4 > 99999;
  # RANGE [irange] int [0, 9999] MASK 0x3fff VALUE 0x0
  _5 = i_4 / 10;
  return _5;

so we know the range of _5 is [0, 9999]..  so we haven't actually lost any
information, other than annotating the load with [0, 99999].  Those other
statements are dead, but have not been removed, so they interfere with setting
global values via builtin_unreachable.

If I add a DCE pass to remove unused locals just before VRP2, we get:

  <bb 2> [local count: 1073741824]:
  # RANGE [irange] int [0, 99999] MASK 0x1ffff VALUE 0x0
  i_4 = *p_3(D);
  # RANGE [irange] int [0, 9999] MASK 0x3fff VALUE 0x0
  _5 = i_4 / 10;
  return _5;

Reply via email to