]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use move-aware auto_vec in map
authorJørgen Kvalsvik <j@lambda.is>
Fri, 28 Jun 2024 06:35:31 +0000 (08:35 +0200)
committerJørgen Kvalsvik <j@lambda.is>
Fri, 28 Jun 2024 13:36:06 +0000 (15:36 +0200)
Using auto_vec rather than vec for means the vectors are release
automatically upon return, to stop the leak. The problem seems is that
auto_vec<T, N> is not really move-aware, only the <T, 0> specialization
is.

gcc/ChangeLog:

* tree-profile.cc (find_conditions): Use auto_vec without
embedded storage.

gcc/tree-profile.cc

index 8c9945847ca46d8303aa471b499490987a87b209..153c9323040a331bb942cb001b1756ccafb37fb3 100644 (file)
@@ -876,7 +876,7 @@ find_conditions (struct function *fn)
     make_top_index (fnblocks, ctx.B1, ctx.top_index);
 
     /* Bin the Boolean expressions so that exprs[id] -> [x1, x2, ...].  */
-    hash_map<int_hash<unsigned, 0>, auto_vec<basic_block, 8>> exprs;
+    hash_map<int_hash<unsigned, 0>, auto_vec<basic_block>> exprs;
     for (basic_block b : fnblocks)
     {
        const unsigned uid = condition_uid (fn, b);