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

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
This is the first release that we process relations in GORI.  Up until recently
it was fairly ad-hoc what got passed in as a relation trio to the op?_range
routines.  A couple of days ago I fleshed it out fully.  I am surprised that
isn't what caused this.

Anyway, the reason its tripping:

  if (_42 != 0)
    goto <bb 10>; [50.00%]
  else
    goto <bb 6>; [50.00%]

bb6:
  _27 = *h_29(D);
  _53 = _27 < _42;
  if (_42 > _53)

we start by trying to evaluate the outgoing edge for _42 on the true side:
[1,1] = (_42 > _53)
The problem is we have determined that _42 is bool [0, 0] at this point.
Knowing _42 is [0, 0], the definition of _53 can never be true, so it is also
bool [0,0]

in order for _53 to be [0,0] AND _42 to be [0,0], the bool value for _27 is
nonsensical..    and thus its being calculated as undefined.

This branch is eventually going to be removed since it can never be taken, but
that hasnt happened at this point yet.

we could fix it at the call site, but you do point out that the opX_range
routines are not gracefully dealing with undefined values.

We probably should audit them all to make sure we handled undefined gracefully
before accessing a bound.

Reply via email to