https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63155
--- Comment #31 from Richard Biener <rguenth at gcc dot gnu.org> --- So we end up with an almost fully set ssa_edge_worklist because we add all the PHIs from blocks we already processed by having visited the backedge defs. But the backedge isn't actually yet executable and avoiding to set those bits brings down the set to a maximum size of 2985 (compared to ~700000 before). So a simpler patch for this particular issue is Index: gcc/tree-ssa-propagate.c =================================================================== --- gcc/tree-ssa-propagate.c (revision 264438) +++ gcc/tree-ssa-propagate.c (working copy) @@ -168,15 +170,26 @@ add_ssa_edge (tree var) FOR_EACH_IMM_USE_FAST (use_p, iter, var) { gimple *use_stmt = USE_STMT (use_p); + basic_block use_bb = gimple_bb (use_stmt); /* If we did not yet simulate the block wait for this to happen and do not add the stmt to the SSA edge worklist. */ - if (! (gimple_bb (use_stmt)->flags & BB_VISITED)) + if (! (use_bb->flags & BB_VISITED)) continue; + /* If this is a use on a not yet executable edge do not bother to + queue it. */ + if (gimple_code (use_stmt) == GIMPLE_PHI + && !(EDGE_PRED (use_bb, PHI_ARG_INDEX_FROM_USE (use_p))->flags + & EDGE_EXECUTABLE)) + return; + if (prop_simulate_again_p (use_stmt) && bitmap_set_bit (ssa_edge_worklist, gimple_uid (use_stmt))) {