Jakub, I summed up to you yesterday on IRC what I expand below; this is just for the public record.
On Dec 13, 2017, Jakub Jelinek <ja...@redhat.com> wrote: > Furthermore, I must say I don't understand why > can_move_early_debug_stmts should care whether there are any labels in > dest bb or not. An earlier attempt tried to move all labels and debug stmts in a single loop, and started with this early debug setting and inserting at the block start stmt, and later switched to the preexisting debug setting and inserting at the after-label stmt. In the end, I decided this was trickier and riskier than two separate loops, but failed to simplify the logic back all the way. > Though, if > gsi_stmt (gsi) == gsi_stmt (gsie), then the loop right below it will not > do anything and nothing cares about can_move_early_debug_stmts afterwards. > So, in short, can_move_early_debug_stmts is used only if > gsi_stmt (gsi) != gsi_stmt (gsie), and therefore > can_move_early_debug_stmts if it is used is can_move_debug_stmts && (1 || > ...); *nod* > So, can we get rid of can_move_early_debug_stmts altogether and just use > can_move_debug_stmts in there instead? Yes. > Another thing I find risky is that you compute gsie_to so early and don't > update it. The point of computing it early was *precisely* to preserve the insertion point should we have both before-label and after-label debug stmts to move. But in the end it doesn't matter: we'll either find the right spot after moving labels, or we'll be at it if there weren't any labels to move. Thanks for the improvements! -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer