https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Now, perhaps the analysis code could also detect which lhs are directly or indirectly needed by debug stmts and when doing this return NULL in remap_gimple_stmt, we could do something like (much simplified) insert_debug_temp_for_var_def in there. Though unsure if we must always handle first the SSA_NAME definitions before uses, if not, then we'd need to figure out the SSA_NAME to DEBUG_EXPR_DECL mapping early and then just let remap_gimple_stmt add the debug stmt for it. Perhaps ignore debug stmts for now as long as it doesn't ICE on them and I'll try to do something for those?