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

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:e753080ab8abd4021381699bc7e857f5b4a083c4

commit r13-5698-ge753080ab8abd4021381699bc7e857f5b4a083c4
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Feb 3 21:39:16 2023 +0100

    range-op: Handle op?.undefined_p () in op[12]_range of comparisons
[PR108647]

    As mentioned in the PR, we ICE because lhs is singleton [0, 0]
    or [1, 1] but op2 (or in other cases op1) is undefined and op?.*_bound ()
    ICEs on those because there are no pairs for UNDEFINED.

    The following patch makes us set r to varying or return false in those
    cases.

    2023-02-03  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/108647
            * range-op.cc (operator_equal::op1_range,
            operator_not_equal::op1_range): Don't test op2 bound
            equality if op2.undefined_p (), instead set_varying.
            (operator_lt::op1_range, operator_le::op1_range,
            operator_gt::op1_range, operator_ge::op1_range): Return false if
            op2.undefined_p ().
            (operator_lt::op2_range, operator_le::op2_range,
            operator_gt::op2_range, operator_ge::op2_range): Return false if
            op1.undefined_p ().

            * g++.dg/torture/pr108647.C: New test.

Reply via email to