public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2953] retain debug stmt order when moving to successors
@ 2021-08-17 11:01 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2021-08-17 11:01 UTC (permalink / raw)
To: gcc-cvs
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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-17 11:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 11:01 [gcc r12-2953] retain debug stmt order when moving to successors Alexandre Oliva
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).