diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-03-04 11:06:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-03-04 11:06:22 +0100 |
commit | 8930f7239bc47706ec49ccb5d285c31ae451f97c (patch) | |
tree | bb7c32bb2703fb371b776ebbc9773689575bb5c8 /gcc/tree-vect-stmts.c | |
parent | 541d9ac892f3dcfbff8d2fb8b00b89e95bb75d1c (diff) | |
download | gcc-8930f7239bc47706ec49ccb5d285c31ae451f97c.zip gcc-8930f7239bc47706ec49ccb5d285c31ae451f97c.tar.gz gcc-8930f7239bc47706ec49ccb5d285c31ae451f97c.tar.bz2 |
re PR middle-end/56461 (GCC is leaking lots of memory)
PR middle-end/56461
* tree-vect-stmts.c (vectorizable_shift): Don't call create methods
on vec_oprnds0 or vec_oprnds1 before loop, only call it on
vec_oprnds1 right before pushing anything to it for
scalar_shift_arg.
From-SVN: r196425
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 1e492bd..927aa3d 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3335,21 +3335,6 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi, /* Handle def. */ vec_dest = vect_create_destination_var (scalar_dest, vectype); - /* Allocate VECs for vector operands. In case of SLP, vector operands are - created in the previous stages of the recursion, so no allocation is - needed, except for the case of shift with scalar shift argument. In that - case we store the scalar operand in VEC_OPRNDS1 for every vector stmt to - be created to vectorize the SLP group, i.e., SLP_NODE->VEC_STMTS_SIZE. - In case of loop-based vectorization we allocate VECs of size 1. We - allocate VEC_OPRNDS1 only in case of binary operation. */ - if (!slp_node) - { - vec_oprnds0.create (1); - vec_oprnds1.create (1); - } - else if (scalar_shift_arg) - vec_oprnds1.create (slp_node->vec_stmts_size); - prev_stmt_info = NULL; for (j = 0; j < ncopies; j++) { @@ -3369,6 +3354,7 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi, dump_printf_loc (MSG_NOTE, vect_location, "operand 1 using scalar mode."); vec_oprnd1 = op1; + vec_oprnds1.create (slp_node ? slp_node->vec_stmts_size : 1); vec_oprnds1.quick_push (vec_oprnd1); if (slp_node) { |