This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/9] Fix leak in gcc/tree-ssa-reassoc.c.
- From: marxin <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 May 2016 12:44:06 +0200
- Subject: [PATCH 3/9] Fix leak in gcc/tree-ssa-reassoc.c.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1463654693 dot git dot mliska at suse dot cz>
- Resent-user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
Leak can be seen e.g. here:
gcc reassoc-11.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -fdump-tree-reassoc1
gcc/ChangeLog:
2016-05-18 Martin Liska <mliska@suse.cz>
* tree-ssa-reassoc.c (eliminate_duplicate_pair): Truncate
an auto_vec instead of re-creating it.
---
gcc/tree-ssa-reassoc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 3b5f36b..81b8977 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -732,7 +732,7 @@ eliminate_duplicate_pair (enum tree_code opcode,
if (ops->length () == 2)
{
- ops->create (0);
+ ops->truncate (0);
add_to_ops_vec (ops, build_zero_cst (TREE_TYPE (last->op)));
*all_done = true;
}
--
2.8.2