[Bug middle-end/126103] ranger: incoming range to a threading path is ignored
aldy at quesejoda dot com
gcc-bugzilla@gcc.gnu.org
Wed Aug 12 08:24:19 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126103
--- Comment #15 from aldy at quesejoda dot com ---
Ughhh this commit got tagged with a wrong PR. It's tangentially
related. Sorry.
On Aug 12, 2026 10:06, "cvs-commit at gcc dot gnu.org"
<gcc-bugzilla@gcc.gnu.org> wrote:
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
<aldyh@gcc.gnu.org>:
https://gcc.gnu.org/g:218575554420ded75052e56d5a89cd23522f20a7
commit r17-3214-g218575554420ded75052e56d5a89cd23522f20a7
Author: Aldy Hernandez <aldy@quesejoda.com>
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.
--
You are receiving this mail because:
You reported the bug.
More information about the Gcc-bugs
mailing list