[Bug tree-optimization/126536] [13/14/15/16/17 Regression] ICE with -funswitch-loops

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=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.
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.