On 5/15/19 2:20 AM, Alexandre Oliva wrote: > Gimple jump threading does not duplicate forwarder blocks that might > be present before or after the second copied block. This silently > drops debug binds and markers that might be present in them. This > patch attempts to preserve them. > > For blocks after either copied block, we attempt to append debug stmts > to the copied block, if it does not end with a block-ending stmt. > Failing that, for blocks between both copied blocks, we prepend its > debug stmts to the copy of the second block. > > If everything fails, we still drop debug stmts on the floor, though > preexisting code consolidates debug binds in the block that threading > flows into, so only markers are really lost. We can't do much better > than that without conditional binds and markers, or debug stmts in > edges, or somesuch. > > If we append debug stmts to a reusable template block, we copy it > after splitting out the debug stmts, and before putting them back. > > Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok to install? > > > for gcc/ChangeLog > > * tree-ssa-threadupdate.c (struct ssa_local_info_t): Add > field template_last_to_copy. > (ssa_create_duplicates): Set it, and use it. Attempt to > preserve more debug stmts. OK. Presumably creating a reliable testcase was painful?
jeff > ---