From 7b9d99e615212c24cecae4202d8def9aa5e71809 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 11 Aug 2021 22:31:55 +0200 Subject: [PATCH] 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'. --- 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 9bde0ac..d308670 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 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 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. */ -- 2.7.4