[Bug tree-optimization/126704] Missing or not complete global range after VRP2 (with and without dom)

amacleod at redhat dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.