https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81900
--- Comment #3 from pipcet at gmail dot com ---
I've investigated some more, and Mikael's bisection appears to confirm my
investigation:
The problem appears to be this chunk:
@@ -2418,7 +2423,9 @@ compute_antic (void)
inverted_post_order_compute (&postorder);
auto_sbitmap worklist (last_basic_block_for_fn (cfun) + 1);
- bitmap_ones (worklist);
+ bitmap_clear (worklist);
+ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds)
+ bitmap_set_bit (worklist, e->src->index);
while (changed)
{
if (dump_file && (dump_flags & TDF_DETAILS))
It assumes there are always edges from function calls to the exit block, when
the function call might exit nonlocally. However,
cfganal.c:add_noreturn_fake_exit_edges is never called for functions that call
setjmp, so such bbs are, wrongly, never visited by compute_antic.
The brute-force method of disabling the tree/PRE pass for functions that call
setjmp() appears to work and fix the issue, but I'm not sure that's the right
way to go.