https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96354
--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> --- But doing that would mean pretty much the same amount of code at the expense of making the IL larger even when not needed (and perhaps risking some optimization opportunities). Yet another possibility would be instead of doing that in this function clear id->regimplify at the start of copy_debug_stmt, and if it is set after processing the value, do something like regimplification for the debug stmts, i.e. walk_tree which would handle the cases we consider invalid, perhaps for now just the MEM_REF case with non-is_gimple_mem_ref_addr/DEBUG_EXPR_DECL as first operand and in the future perhaps something else too.