From: Jakub Jelinek Date: Mon, 4 Mar 2013 10:02:26 +0000 (+0100) Subject: re PR middle-end/56461 (GCC is leaking lots of memory) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=541d9ac892f3dcfbff8d2fb8b00b89e95bb75d1c;p=gcc.git re PR middle-end/56461 (GCC is leaking lots of memory) PR middle-end/56461 * tree-vect-loop.c (destroy_loop_vec_info): For !clean_stmts, just set nbbs to 0 instead of having separate code path. (vect_analyze_loop_form): Call destroy_loop_vec_info with true instead of false as last argument if returning NULL. From-SVN: r196424 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e94430ad3e1..e58e46a0d87 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-03-04 Jakub Jelinek + + PR middle-end/56461 + * tree-vect-loop.c (destroy_loop_vec_info): For !clean_stmts, just + set nbbs to 0 instead of having separate code path. + (vect_analyze_loop_form): Call destroy_loop_vec_info with true + instead of false as last argument if returning NULL. + 2013-03-03 Sandra Loosemore * target.def (TARGET_OPTION_VALID_ATTRIBUTE_P): Update comments; diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 6f71016080e..8be53bb02c8 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -905,23 +905,9 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts) loop = LOOP_VINFO_LOOP (loop_vinfo); bbs = LOOP_VINFO_BBS (loop_vinfo); - nbbs = loop->num_nodes; + nbbs = clean_stmts ? loop->num_nodes : 0; swapped = LOOP_VINFO_OPERANDS_SWAPPED (loop_vinfo); - if (!clean_stmts) - { - free (LOOP_VINFO_BBS (loop_vinfo)); - free_data_refs (LOOP_VINFO_DATAREFS (loop_vinfo)); - free_dependence_relations (LOOP_VINFO_DDRS (loop_vinfo)); - LOOP_VINFO_LOOP_NEST (loop_vinfo).release (); - LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo).release (); - LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo).release (); - - free (loop_vinfo); - loop->aux = NULL; - return; - } - for (j = 0; j < nbbs; j++) { basic_block bb = bbs[j]; @@ -1244,7 +1230,7 @@ vect_analyze_loop_form (struct loop *loop) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: number of iterations = 0."); if (inner_loop_vinfo) - destroy_loop_vec_info (inner_loop_vinfo, false); + destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; }