On Tue, Aug 11, 2026 at 7:42 PM Andrew MacLeod <[email protected]> wrote:
>
> irange::invert does not return a value. The PR demonstrates that there
> are occasions when the provided range has a maximal amount of subranges,
> and one more is required to properly represent invert.   IN this case,
> the range object cannot be grown, and invert will not return the correct
> result.
>
> This patch adds a return value to irange::invert and prange::invert and
> checks the value at each use location.   Some places we never expect to
> fail, and in those cases I simply added a gcc_checking_assert on the
> return value.  Others return false.     Invert does not handle VARYING
> and UNDEFINED, and I replaced the checking assert with return false for
> those cases.
>
> Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed.
>
> Andrew
>
> PS  I think the change to tree-ssa-loop-unswitch.cc is correct, but
> perhaps someone else should check it :-P

It looks conservative yes.  I do wonder why upon allocation failure
we are not simply merging the last two subranges conservatively?

>

Reply via email to