https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116601
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The fix which I am testing: ``` diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index 44711018e0e..3cd385f476b 100644 --- a/gcc/tree-ssa-ccp.cc +++ b/gcc/tree-ssa-ccp.cc @@ -4325,8 +4325,15 @@ pass_fold_builtins::execute (function *fun) if (gimple_code (stmt) != GIMPLE_CALL) { if (gimple_assign_load_p (stmt) && gimple_store_p (stmt)) - optimize_memcpy (&i, gimple_assign_lhs (stmt), - gimple_assign_rhs1 (stmt), NULL_TREE); + { + optimize_memcpy (&i, gimple_assign_lhs (stmt), + gimple_assign_rhs1 (stmt), NULL_TREE); + old_stmt = stmt; + stmt = gsi_stmt (i); + if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt) + && gimple_purge_dead_eh_edges (bb)) + cfg_changed = true; + } gsi_next (&i); continue; } ```