https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #11 from Martin Jambor <jamborm at gcc dot gnu.org> --- I'm going to test a patch that basically does the following (plus moving push_cfun a bit): diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c index 31de527d111..e18dc6958dc 100644 --- a/gcc/ipa-sra.c +++ b/gcc/ipa-sra.c @@ -862,6 +862,14 @@ isra_track_scalar_value_uses (cgraph_node *node, tree name, int parm_num, else if ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt)) || gimple_code (stmt) == GIMPLE_PHI) { + if (!flag_tree_dce) + { + /* We depend on DCE to clean up statements that we discover to be + unnecessary. */ + res = -1; + BREAK_FROM_IMM_USE_STMT (imm_iter); + } + tree lhs; if (gimple_code (stmt) == GIMPLE_PHI) lhs = gimple_phi_result (stmt);