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

--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> ---
Seems like maybe invert() ought to return a false if it cant perform the
operation, or fit it into the supplied range.

Then the caller can avoid doing whatever it was going to.  

If we cant be precise, ie
  x = y
  x.invert();
  x.invert();
  assert (x == y)

We could then have UNDEFINED and VARYING return false as well instead of having
a checking assert.

seems like this could also occur when using smaller fixed size ranges.

For unswitching I guess we'd be turning it off if we cant represent it.. or is
there an alternative approach we use if there are 4000 cases? 

I'll prepare a patch set to add a return value to invert if it fails
regardless.

Reply via email to