summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-08-16 14:27:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-08-16 14:27:51 +0000
commitf5843d08b462559af731ed7bd40f2d8e7a1b47e1 (patch)
tree376f51f58149bf3a9c71811ae304381e607e6ff2 /gcc/tree-ssa-loop-im.c
parent0c8036f70a641b1821290e0c7f35c5a911a4a77a (diff)
downloadgcc-f5843d08b462559af731ed7bd40f2d8e7a1b47e1.tar.gz
re PR middle-end/54146 (Very slow compile with attribute((flatten)))
2012-08-16 Richard Guenther <rguenther@suse.de> PR middle-end/54146 * tree-ssa-loop-niter.c (find_loop_niter_by_eval): Free the exit vector. * ipa-pure-const.c (analyze_function): Use FOR_EACH_LOOP_BREAK. * cfgloop.h (FOR_EACH_LOOP_BREAK): Fix. * tree-ssa-structalias.c (handle_lhs_call): Properly free rhsc. * tree-into-ssa.c (get_ssa_name_ann): Allocate info only when needed. * tree-ssa-loop-im.c (analyze_memory_references): Adjust. (tree_ssa_lim_finalize): Free all mem_refs. * tree-ssa-sccvn.c (extract_and_process_scc_for_name): Free scc when bailing out. * modulo-sched.c (sms_schedule): Use FOR_EACH_LOOP_BREAK. * ira-build.c (loop_with_complex_edge_p): Free loop exit vector. * graphite-sese-to-poly.c (scop_ivs_can_be_represented): Use FOR_EACH_LOOP_BREAK. From-SVN: r190445
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index e40a6e4098d..caffe8250f1 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -1486,9 +1486,8 @@ free_mem_ref_locs (mem_ref_locs_p accs)
/* A function to free the mem_ref object OBJ. */
static void
-memref_free (void *obj)
+memref_free (struct mem_ref *mem)
{
- struct mem_ref *const mem = (struct mem_ref *) obj;
unsigned i;
mem_ref_locs_p accs;
@@ -1728,8 +1727,7 @@ analyze_memory_references (void)
unsigned i;
bitmap empty;
- memory_accesses.refs
- = htab_create (100, memref_hash, memref_eq, memref_free);
+ memory_accesses.refs = htab_create (100, memref_hash, memref_eq, NULL);
memory_accesses.refs_list = NULL;
memory_accesses.refs_in_loop = VEC_alloc (bitmap, heap,
number_of_loops ());
@@ -2617,6 +2615,7 @@ tree_ssa_lim_finalize (void)
basic_block bb;
unsigned i;
bitmap b;
+ mem_ref_p ref;
free_aux_for_edges ();
@@ -2625,9 +2624,12 @@ tree_ssa_lim_finalize (void)
pointer_map_destroy (lim_aux_data_map);
- VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
htab_delete (memory_accesses.refs);
+ FOR_EACH_VEC_ELT (mem_ref_p, memory_accesses.refs_list, i, ref)
+ memref_free (ref);
+ VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
+
FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b)
BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.refs_in_loop);