On 6/14/21 4:04 PM, Richard Biener wrote:
The same issue that arises in PR100934 can happen in the backward
threader now (Aldy?) - we eventually run into mark_irreducible_loops
for non-FSM thread paths checking for paths crossing irreducible
region boundaries.
I haven't been following the above PR, so I may be missing something,
but it seems like you would need to twiddle all users of the path
registry, not just the backwards threader.
/* Try to thread each block with more than one successor. */
thread_jumps threader (/*speed_p=*/false);
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index a86302be18e..387994fd882 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -1917,6 +1917,8 @@ jump_thread_path_registry::mark_threaded_blocks (bitmap
threaded_blocks)
edge e;
edge_iterator ei;
+ gcc_assert (loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS));
+
/* It is possible to have jump threads in which one is a subpath
of the other. ie, (A, B), (B, C), (C, D) where B is a joiner
block and (B, C), (C, D) where no joiner block exists.
If you're asserting this, don't you need to initialize DOM and VRP with
LOOPS_MAY_HAVE_MARKED_IRREDUCIBLE_REGIONS as well? They may use the
registry via their jump_threader.
Hmmm...tree-vrp seems fine:
loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS);
because LOOPS_NORMAL includes LOOPS_MAY_HAVE_MARKED_IRREDUCIBLE_REGIONS.
But you may need some massaging in DOM:
loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES);
Aldy