public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2924] Clarify memory management for 'prop_set' in 'gcc/omp-oacc-neuter-broadcast.cc'
@ 2021-08-16 10:12 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-08-16 10:12 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7b9d99e615212c24cecae4202d8def9aa5e71809
commit r12-2924-g7b9d99e615212c24cecae4202d8def9aa5e71809
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed Aug 11 22:31:55 2021 +0200
Clarify memory management for 'prop_set' in 'gcc/omp-oacc-neuter-broadcast.cc'
Clean-up for recent commit e2a58ed6dc5293602d0d168475109caa81ad0f0d
"openacc: Middle-end worker-partitioning support".
gcc/
* omp-oacc-neuter-broadcast.cc
(execute_omp_oacc_neuter_broadcast): Clarify memory management for
'prop_set'.
Diff:
---
gcc/omp-oacc-neuter-broadcast.cc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/omp-oacc-neuter-broadcast.cc b/gcc/omp-oacc-neuter-broadcast.cc
index 9bde0aca10f..d30867085c3 100644
--- a/gcc/omp-oacc-neuter-broadcast.cc
+++ b/gcc/omp-oacc-neuter-broadcast.cc
@@ -1398,11 +1398,8 @@ execute_omp_oacc_neuter_broadcast ()
FOR_ALL_BB_FN (bb, cfun)
bb->aux = NULL;
- vec<propagation_set *> prop_set;
- prop_set.create (last_basic_block_for_fn (cfun));
-
- for (int i = 0; i < last_basic_block_for_fn (cfun); i++)
- prop_set.quick_push (0);
+ vec<propagation_set *> prop_set (vNULL);
+ prop_set.safe_grow_cleared (last_basic_block_for_fn (cfun), true);
find_ssa_names_to_propagate (par, mask, worker_single, vector_single,
&prop_set);
@@ -1461,6 +1458,9 @@ execute_omp_oacc_neuter_broadcast ()
delete it.second;
record_field_map.empty ();
+ /* These are supposed to have been 'delete'd by 'neuter_worker_single'. */
+ for (auto it : prop_set)
+ gcc_checking_assert (!it);
prop_set.release ();
/* This doesn't seem to make a difference. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-16 10:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 10:12 [gcc r12-2924] Clarify memory management for 'prop_set' in 'gcc/omp-oacc-neuter-broadcast.cc' Thomas Schwinge
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).