aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-05-06 16:26:23 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-05-06 14:26:23 +0000
commit734c152691823eb7a12855783b67d738bd1cf701 (patch)
tree040340d59b50ec6295923f5b990bb7878e8ae455 /gcc
parent9bdf001b7a2232753e4a92582218bb4f24c8d809 (diff)
downloadgcc-734c152691823eb7a12855783b67d738bd1cf701.zip
gcc-734c152691823eb7a12855783b67d738bd1cf701.tar.gz
gcc-734c152691823eb7a12855783b67d738bd1cf701.tar.bz2
Fix memory leak in tree-if-conv.c
* tree-if-conv.c (ifcvt_split_critical_edges): Use auto_vec instead of vec as the vector is local to the function. From-SVN: r235974
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-if-conv.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1fbc350..6593023 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-06 Martin Liska <mliska@suse.cz>
+
+ * tree-if-conv.c (ifcvt_split_critical_edges): Use auto_vec
+ instead of vec as the vector is local to the function.
+
2016-05-06 Jakub Jelinek <jakub@redhat.com>
* config/i386/sse.md (*<code>v8hi3, *<code>v16qi3): Add
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 3d7c613..3ad8e87 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -2361,7 +2361,7 @@ ifcvt_split_critical_edges (struct loop *loop, bool aggressive_if_conv)
gimple *stmt;
edge e;
edge_iterator ei;
- vec<edge> critical_edges = vNULL;
+ auto_vec<edge> critical_edges;
/* Loop is not well formed. */
if (num <= 2 || loop->inner || !single_exit (loop))
@@ -2381,7 +2381,6 @@ ifcvt_split_critical_edges (struct loop *loop, bool aggressive_if_conv)
bb->index, MAX_PHI_ARG_NUM);
free (body);
- critical_edges.release ();
return false;
}
if (bb == loop->latch || bb_with_exit_edge_p (loop, bb))