public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-9756] remove write-only array in rev_post_order_and_mark_dfs_back_seme
@ 2021-04-23 13:00 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-04-23 13:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:9db2c895fe2cb2aba61f6ef006c6f6c46ef07521
commit r10-9756-g9db2c895fe2cb2aba61f6ef006c6f6c46ef07521
Author: Richard Biener <rguenther@suse.de>
Date: Mon Jul 20 15:58:19 2020 +0200
remove write-only array in rev_post_order_and_mark_dfs_back_seme
This removes a write-only array in
rev_post_order_and_mark_dfs_back_seme.
2020-07-20 Richard Biener <rguenther@suse.de>
* cfganal.c (rev_post_order_and_mark_dfs_back_seme): Remove
write-only post array.
(cherry picked from commit 57d4771b7c15db139043bf41a03b8abe01e11f18)
Diff:
---
gcc/cfganal.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 395b810262a..5c85ebe3c1a 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -1079,13 +1079,12 @@ rev_post_order_and_mark_dfs_back_seme (struct function *fn, edge entry,
a need to re-allocate. */
auto_vec<edge, 20> stack (2 * n_basic_blocks_for_fn (fn));
- int *pre = XNEWVEC (int, 2 * last_basic_block_for_fn (fn));
- int *post = pre + last_basic_block_for_fn (fn);
+ int *pre = XNEWVEC (int, last_basic_block_for_fn (fn));
/* BB flag to track nodes that have been visited. */
auto_bb_flag visited (fn);
- /* BB flag to track which nodes have post[] assigned to avoid
- zeroing post. */
+ /* BB flag to track which nodes have postorder visting completed. Used
+ for backedge marking. */
auto_bb_flag post_assigned (fn);
/* Push the first edge on to the stack. */
@@ -1133,7 +1132,6 @@ rev_post_order_and_mark_dfs_back_seme (struct function *fn, edge entry,
{
/* There are no successors for the DEST node so assign
its reverse completion number. */
- post[dest->index] = rev_post_order_num;
dest->flags |= post_assigned;
rev_post_order[rev_post_order_num] = dest->index;
rev_post_order_num++;
@@ -1142,16 +1140,15 @@ rev_post_order_and_mark_dfs_back_seme (struct function *fn, edge entry,
else
{
if (dest->flags & visited
+ && !(dest->flags & post_assigned)
&& src != entry->src
- && pre[src->index] >= pre[dest->index]
- && !(dest->flags & post_assigned))
+ && pre[src->index] >= pre[dest->index])
e->flags |= EDGE_DFS_BACK;
if (idx != 0 && stack[idx - 1]->src != src)
{
/* There are no more successors for the SRC node
so assign its reverse completion number. */
- post[src->index] = rev_post_order_num;
src->flags |= post_assigned;
rev_post_order[rev_post_order_num] = src->index;
rev_post_order_num++;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-23 13:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 13:00 [gcc r10-9756] remove write-only array in rev_post_order_and_mark_dfs_back_seme Richard Biener
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).