From 1e485f89d8173c1d64927db116698f6ad15ad0bb Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 17 Aug 2017 21:56:46 +0200 Subject: [PATCH] Fix build of --enable-gather-detailed-mem-stats (PR bootstrap/81864). 2017-08-17 Martin Liska PR bootstrap/81864 * tree-loop-distribution.c (ddrs_table): Change type to pointer type. (get_data_dependence): Use it as pointer type. (distribute_loop): Likewise. From-SVN: r251165 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-loop-distribution.c | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17b49295d4e..4544c8500c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-08-17 Martin Liska + + PR bootstrap/81864 + * tree-loop-distribution.c (ddrs_table): Change type to pointer + type. + (get_data_dependence): Use it as pointer type. + (distribute_loop): Likewise. + 2017-08-17 Bill Schmidt * config/rs6000/altivec.md (UNSPEC_VMRGOW_DIRECT): New constant. diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index b1b293419b0..26b8b9a3751 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -157,8 +157,7 @@ static vec datarefs_vec; #define DR_INDEX(dr) ((uintptr_t) (dr)->aux) /* Hash table for data dependence relation in the loop to be distributed. */ -static hash_table ddrs_table (389); - +static hash_table *ddrs_table; /* A Reduced Dependence Graph (RDG) vertex representing a statement. */ struct rdg_vertex @@ -1183,7 +1182,7 @@ get_data_dependence (struct graph *rdg, data_reference_p a, data_reference_p b) <= rdg_vertex_for_stmt (rdg, DR_STMT (b))); ent.a = a; ent.b = b; - slot = ddrs_table.find_slot (&ent, INSERT); + slot = ddrs_table->find_slot (&ent, INSERT); if (*slot == NULL) { ddr = initialize_data_dependence_relation (a, b, loop_nest); @@ -2366,6 +2365,7 @@ static int distribute_loop (struct loop *loop, vec stmts, control_dependences *cd, int *nb_calls, bool *destroy_p) { + ddrs_table = new hash_table (389); struct graph *rdg; partition *partition; bool any_builtin; @@ -2377,6 +2377,7 @@ distribute_loop (struct loop *loop, vec stmts, if (!find_loop_nest (loop, &loop_nest)) { loop_nest.release (); + delete ddrs_table; return 0; } @@ -2391,6 +2392,7 @@ distribute_loop (struct loop *loop, vec stmts, loop_nest.release (); free_data_refs (datarefs_vec); + delete ddrs_table; return 0; } @@ -2404,6 +2406,7 @@ distribute_loop (struct loop *loop, vec stmts, free_rdg (rdg); loop_nest.release (); free_data_refs (datarefs_vec); + delete ddrs_table; return 0; } @@ -2542,13 +2545,13 @@ distribute_loop (struct loop *loop, vec stmts, ldist_done: loop_nest.release (); free_data_refs (datarefs_vec); - for (hash_table::iterator iter = ddrs_table.begin (); - iter != ddrs_table.end (); ++iter) + for (hash_table::iterator iter = ddrs_table->begin (); + iter != ddrs_table->end (); ++iter) { free_dependence_relation (*iter); *iter = NULL; } - ddrs_table.empty (); + delete ddrs_table; FOR_EACH_VEC_ELT (partitions, i, partition) partition_free (partition); -- 2.30.2