aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-02-10 10:17:15 +0100
committerRichard Biener <rguenther@suse.de>2021-02-10 11:31:13 +0100
commit72932511053596091ad291539022b51d9f2ba418 (patch)
treedeed5164277a505e145f917fc814cd9878f0d746 /gcc/cfgrtl.c
parentbd0e37f68a3aed944df4eb739a0734bb87153749 (diff)
downloadgcc-72932511053596091ad291539022b51d9f2ba418.zip
gcc-72932511053596091ad291539022b51d9f2ba418.tar.gz
gcc-72932511053596091ad291539022b51d9f2ba418.tar.bz2
rtl-optimization/99054 - fix leak in fixup_partitions
This fixes a leak of the vector retured by find_partition_fixes by turning it into an auto_vec. 2021-02-10 Richard Biener <rguenther@suse.de> PR rtl-optimization/99054 * cfgrtl.c (rtl-optimization/99054): Return an auto_vec. (fixup_partitions): Adjust. (rtl_verify_edges): Likewise.
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 1d51212..3f55a32 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2381,11 +2381,11 @@ find_bbs_reachable_by_hot_paths (hash_set<basic_block> *set)
cfg optimizations that may make hot blocks previously reached
by both hot and cold blocks now only reachable along cold paths. */
-static vec<basic_block>
+static auto_vec<basic_block>
find_partition_fixes (bool flag_only)
{
basic_block bb;
- vec<basic_block> bbs_to_fix = vNULL;
+ auto_vec<basic_block> bbs_to_fix;
hash_set<basic_block> set;
/* Callers check this. */
@@ -2431,7 +2431,7 @@ fixup_partitions (void)
  a cold partition cannot dominate a basic block in a hot partition.
Fixup any that now violate this requirement, as a result of edge
forwarding and unreachable block deletion.  */
- vec<basic_block> bbs_to_fix = find_partition_fixes (false);
+ auto_vec<basic_block> bbs_to_fix = find_partition_fixes (false);
/* Do the partition fixup after all necessary blocks have been converted to
cold, so that we only update the region crossings the minimum number of
@@ -2682,7 +2682,7 @@ rtl_verify_edges (void)
if (crtl->has_bb_partition && !err
&& current_ir_type () == IR_RTL_CFGLAYOUT)
{
- vec<basic_block> bbs_to_fix = find_partition_fixes (true);
+ auto_vec<basic_block> bbs_to_fix = find_partition_fixes (true);
err = !bbs_to_fix.is_empty ();
}