]> git.ipfire.org Git - thirdparty/gcc.git/commit
preserve more debug stmts in gimple jump threading
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 21 May 2019 17:09:13 +0000 (17:09 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 21 May 2019 17:09:13 +0000 (17:09 +0000)
commit40dada26a785875a9ed698e87f952acc26237895
tree7ed80d7378e9dfeac3d2b03e85a36140e336f670
parent53329d29274fa4af5af7ab155947fe84b9684e39
preserve more debug stmts in gimple jump threading

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.

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.

From-SVN: r271477
gcc/ChangeLog
gcc/tree-ssa-threadupdate.c