Hi!

4.7 did here:
  VEC_free (tree, heap, *vec_oprnds0);
  *vec_oprnds0 = vec_tmp;
so vec_oprnds0->truncate (0) doesn't match that, and leaks memory.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2013-03-01  Jakub Jelinek  <ja...@redhat.com>

        PR middle-end/56461
        * tree-vect-stmts.c (vect_create_vectorized_promotion_stmts): Call
        vec_oprnds0->release (); rather than vec_oprnds0->truncate (0)
        before overwriting it.

--- gcc/tree-vect-stmts.c.jj    2013-03-01 12:39:08.000000000 +0100
+++ gcc/tree-vect-stmts.c       2013-03-01 13:33:37.796121184 +0100
@@ -2269,7 +2269,7 @@ vect_create_vectorized_promotion_stmts (
       vec_tmp.quick_push (new_tmp2);
     }
 
-  vec_oprnds0->truncate (0);
+  vec_oprnds0->release ();
   *vec_oprnds0 = vec_tmp;
 }
 

        Jakub

Reply via email to