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

--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <[email protected]>:

https://gcc.gnu.org/g:218575554420ded75052e56d5a89cd23522f20a7

commit r17-3214-g218575554420ded75052e56d5a89cd23522f20a7
Author: Aldy Hernandez <[email protected]>
Date:   Tue Aug 11 08:36:36 2026 +0000

    Thread paths ending in a computed goto

    The backward threader only handles paths ending in a GIMPLE_COND or
    GIMPLE_SWITCH, even though the profitability code and the generic
    copier already accounts for GIMPLE_GOTO.  When we rewrote the
    backwards threader, the GIMPLE_GOTO handling was silently dropped
    because (a) ranger couldn't handle symbolics (b) DOM was picking our
    slack.  Now with DOM removal in our sights, we need to handle computed
    gotos.  This has been made trivial, by the recent work in prange
    providing points-to info.

    Note that a destination occurring in an abnormal PHI (when the goto
    block is itself one of the goto's targets) is still not handled.  I'll
    be working on abnormal edge handling as a follow-up.

    Tested on ppc64le Linux.

    gcc/ChangeLog:

            PR tree-optimization/126103
            * tree-ssa-threadbackward.cc (class back_threader): Add
            find_taken_edge_goto.
            (back_threader::find_taken_edge): Handle GIMPLE_GOTO.
            (back_threader::find_taken_edge_goto): New.
            (back_threader::maybe_thread_block): Handle GIMPLE_GOTO.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/126103
            * gcc.dg/pr89737.c: Add -fno-thread-jumps.
            * gcc.dg/tree-ssa/backthread-computed-goto-1.c: New test.
            * gcc.dg/tree-ssa/backthread-computed-goto-3.c: New test.

Reply via email to