The following were found compiling SPEC CPU 2017 with valgrind.

Bootstrap and regtest pending on x86_64-unknown-linux-gnu.

        * tree-vect-slp.cc (vect_analyze_slp): Release saved_stmts
        vector.
        (vect_build_slp_tree_2): Release new_oprnds_info when not
        used.
---
 gcc/tree-vect-slp.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 337506419d9..8188f6b07c5 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -2678,6 +2678,8 @@ out:
          nops = 1;
          has_two_operators_perm = true;
        }
+      else
+       vect_free_oprnd_info (new_oprnds_info);
     }
 
   auto_vec<slp_tree, 4> children;
@@ -4951,8 +4953,8 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size,
                                           max_tree_size, &limit,
                                           bst_map, NULL, force_single_lane);
                }
-             saved_stmts.release ();
            }
+         saved_stmts.release ();
        }
 
       /* Make sure to vectorize only-live stmts, usually inductions.  */
-- 
2.43.0

Reply via email to