https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108880
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #10) > Another simple patch is > > --- a/gcc/c-family/c-gimplify.cc > +++ b/gcc/c-family/c-gimplify.cc > @@ -516,7 +516,7 @@ c_genericize_control_stmt (tree *stmt_p, int > *walk_subtrees, void *data, > tree t = tsi_stmt (i); > if (TREE_CODE (t) != DEBUG_BEGIN_STMT && nondebug_stmts < 2) > nondebug_stmts++; > - walk_tree_1 (tsi_stmt_ptr (i), func, data, NULL, lh); > + walk_tree_without_duplicates_1 (tsi_stmt_ptr (i), func, data, lh); > if (TREE_CODE (t) != DEBUG_BEGIN_STMT > && (nondebug_stmts > 1 || TREE_SIDE_EFFECTS (tsi_stmt (i)))) > clear_side_effects = false; But that creates another pset, this time another one for each statement in each STATEMENT_LIST seen. That would be terribly expensive. While the cp_genericize_r pset is just one for the whole function, the one used by walk_tree_without_duplicates for C is also one for the whole function.