public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2953] retain debug stmt order when moving to successors Date: Tue, 17 Aug 2021 11:01:48 +0000 (GMT) [thread overview] Message-ID: <20210817110148.A573C383601E@sourceware.org> (raw) https://gcc.gnu.org/g:6bcbf80c6e2bd8a60d88bbcac3d70ffb67f4888f commit r12-2953-g6bcbf80c6e2bd8a60d88bbcac3d70ffb67f4888f Author: Alexandre Oliva <oliva@adacore.com> Date: Sat Jul 24 23:05:33 2021 -0300 retain debug stmt order when moving to successors We iterate over debug stmts from the last one in new_bb, and we insert them before the first post-label stmt in each dest block, without moving the insertion iterator, so they end up reversed. Moving the insertion iterator fixes this. for gcc/ChangeLog * tree-inline.c (maybe_move_debug_stmts_to_successors): Don't reverse debug stmts. Diff: --- gcc/tree-inline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c5d6b1e6489..5955ff18fdb 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2880,7 +2880,7 @@ maybe_move_debug_stmts_to_successors (copy_body_data *id, basic_block new_bb) gimple_set_location (stmt, UNKNOWN_LOCATION); } gsi_remove (&si, false); - gsi_insert_before (&dsi, stmt, GSI_SAME_STMT); + gsi_insert_before (&dsi, stmt, GSI_NEW_STMT); continue; } @@ -2906,7 +2906,7 @@ maybe_move_debug_stmts_to_successors (copy_body_data *id, basic_block new_bb) new_stmt = as_a <gdebug *> (gimple_copy (stmt)); else gcc_unreachable (); - gsi_insert_before (&dsi, new_stmt, GSI_SAME_STMT); + gsi_insert_before (&dsi, new_stmt, GSI_NEW_STMT); id->debug_stmts.safe_push (new_stmt); gsi_prev (&ssi); }
reply other threads:[~2021-08-17 11:01 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210817110148.A573C383601E@sourceware.org \ --to=aoliva@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).