https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96354
--- Comment #20 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 29 Jul 2020, jakub at gcc dot gnu.org wrote: > 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. Meh. I guess let's try not ICEing during maybe_canonicalize_mem_ref_addr instead, thus make it "best effort" for GIMPLE_DEBUG stmts. Or not fold it at all. But I guess that we do and only do maybe_canonicalize_mem_ref_addr means we've run into problems before... like PR45056?