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

--- Comment #16 from GCC 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:f3dde39e597f48832208f423fb20f29674ce49ae

commit r16-1409-gf3dde39e597f48832208f423fb20f29674ce49ae
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Jun 11 07:03:04 2025 +0200

    ranger: Handle the theoretical case of GIMPLE_COND with one succ edge
during expansion [PR120434]

    On Tue, Jun 10, 2025 at 10:51:25AM -0400, Andrew MacLeod wrote:
    > Edge range should be fine, and really that assert doesnt really need to
be
    > there.
    >
    > Where the issue could arise is in gimple-range-fold.cc in
    > fold_using_range::range_of_range_op()  where we see something like:
    >
    >          else if (is_a<gcond *> (s) && gimple_bb (s))
    >             {
    >               basic_block bb = gimple_bb (s);
    >               edge e0 = EDGE_SUCC (bb, 0);
    >               edge e1 = EDGE_SUCC (bb, 1);
    >
    >               if (!single_pred_p (e0->dest))
    >                 e0 = NULL;
    >               if (!single_pred_p (e1->dest))
    >                 e1 = NULL;
    >               src.register_outgoing_edges (as_a<gcond *> (s),
    >                                            as_a <irange> (r), e0, e1);
    >
    > Althogh, now that I look at it, it doesn't need much adjustment, just the
    > expectation that there are 2 edges.  I suppose EDGE_SUCC (bb, 1) cpould
    > potentially trap if there is only one edge.   we'd just have to guard it
and
    > alloow for that case

    This patch implements that.

    2025-06-11  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/120434
            * gimple-range-fold.cc: Include rtl.h.
            (fold_using_range::range_of_range_op): Handle bb ending with
            GIMPLE_COND during RTL expansion where there is only one succ
            edge instead of two.

Reply via email to