diff options
author | Richard Guenther <rguenther@suse.de> | 2008-02-28 09:56:54 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-02-28 09:56:54 +0000 |
commit | 3b3024215fae5daf1db2634fe070061837947458 (patch) | |
tree | 827872f3375cda4e3f251831d7fabfc631d7be29 /gcc/tree-ssa.c | |
parent | f4abe9e0e3f36d33d40aed76f7b5a40d84f3e5f8 (diff) | |
download | gcc-3b3024215fae5daf1db2634fe070061837947458.zip gcc-3b3024215fae5daf1db2634fe070061837947458.tar.gz gcc-3b3024215fae5daf1db2634fe070061837947458.tar.bz2 |
revert: tree-flow.h (uid_decl_map_hash, [...]): Move ...
2008-02-28 Richard Guenther <rguenther@suse.de>
Revert:
2008-02-26 Richard Guenther <rguenther@suse.de>
* tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ...
* tree.h (uid_decl_map_hash, uid_decl_map_eq): ... here.
(lookup_decl_from_uid): Declare.
(remove_decl_from_map): Likewise.
* tree-ssa.c (uid_decl_map_eq, uid_decl_map_hash): Move ...
* tree.c (uid_decl_map_eq, uid_decl_map_hash): ... here.
(decl_for_uid_map): New global hashtable mapping DECL_UID
to the decl tree.
(init_ttree): Allocate it.
(insert_decl_to_uid_decl_map): New helper function.
(make_node_stat): Insert new decls into the map.
(copy_node_stat): Likewise.
(lookup_decl_from_uid): New function.
(remove_decl_from_map): Likewise.
(print_decl_for_uid_map_statistics): New helper.
(dump_tree_statistics): Call it.
cp/
* decl.c (duplicate_decls): Remove decl from global mapping
before ggc_freeing it.
* tree-flow.h (struct gimple_df): Make referenced_vars a bitmap.
(referenced_var_iterator): Adjust.
(FOR_EACH_REFERENCED_VAR): Adjust.
(FOR_EACH_REFERENCED_VAR_IN_BITMAP): New iterator.
(num_referenced_vars): Adjust.
* tree-flow-inline.h (gimple_referenced_vars): Adjust.
(first_referenced_var): Remove.
(end_referenced_vars_p): Likewise.
(next_referenced_var): Likewise.
(referenced_var_iterator_set): New helper function.
* tree-dfa.c (referenced_var_lookup): Adjust.
(referenced_var_check_and_insert): Likewise.
(remove_referenced_var): Likewise.
* tree-ssa.c (verify_flow_insensitive_alias_info): Use
FOR_EACH_REFERENCED_VAR_IN_BITMAP.
(verify_call_clobbering): Likewise.
(verify_memory_partitions): Likewise.
(init_tree_ssa): Allocate bitmap instead of hashtable for
referenced_vars.
(delete_tree_ssa): Adjust.
* tree-ssa-alias.c (mark_aliases_call_clobbered): Use
FOR_EACH_REFERENCED_VAR_IN_BITMAP.
(compute_tag_properties): Likewise.
(set_initial_properties): Likewise.
(find_partition_for): Likewise.
(update_reference_counts): Likewise.
(dump_may_aliases_for): Likewise.
* tree-ssa-operands.c (add_virtual_operand): Likewise.
(add_call_clobber_ops): Likewise.
(add_call_read_ops): Likewise.
(get_asm_expr_operands): Likewise.
* tree-into-ssa.c (dump_decl_set): Likewise.
(update_ssa): Likewise.
* tree-sra.c (scan_function): Likewise.
(decide_instantiations): Likewise.
(scalarize_parms): Likewise.
* tree-ssa-alias-warnings.c (build_reference_table): Likewise.
(dsa_named_for): Likewise.
* tree-ssa-structalias.c (update_alias_info): Likewise.
(merge_smts_into): Likewise.
From-SVN: r132740
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 77 |
1 files changed, 54 insertions, 23 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 7b89e22..6c06df0 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -378,23 +378,28 @@ verify_flow_insensitive_alias_info (void) FOR_EACH_REFERENCED_VAR (var, rvi) { + unsigned int j; bitmap aliases; tree alias; - referenced_var_iterator ri; + bitmap_iterator bi; if (!MTAG_P (var) || !MTAG_ALIASES (var)) continue; aliases = MTAG_ALIASES (var); - FOR_EACH_REFERENCED_VAR_IN_BITMAP (aliases, alias, ri) - if (TREE_CODE (alias) != MEMORY_PARTITION_TAG - && !may_be_aliased (alias)) - { - error ("non-addressable variable inside an alias set"); - debug_variable (alias); - goto err; - } + EXECUTE_IF_SET_IN_BITMAP (aliases, 0, j, bi) + { + alias = referenced_var (j); + + if (TREE_CODE (alias) != MEMORY_PARTITION_TAG + && !may_be_aliased (alias)) + { + error ("non-addressable variable inside an alias set"); + debug_variable (alias); + goto err; + } + } } return; @@ -481,17 +486,20 @@ err: static void verify_call_clobbering (void) { - referenced_var_iterator rvi; + unsigned int i; + bitmap_iterator bi; tree var; + referenced_var_iterator rvi; /* At all times, the result of the call_clobbered flag should match the result of the call_clobbered_vars bitmap. Verify both that everything in call_clobbered_vars is marked call_clobbered, and that everything marked call_clobbered is in call_clobbered_vars. */ - FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun), - var, rvi) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi) { + var = referenced_var (i); + if (memory_partition (var)) var = memory_partition (var); @@ -542,8 +550,8 @@ verify_memory_partitions (void) for (i = 0; VEC_iterate (tree, mpt_table, i, mpt); i++) { - referenced_var_iterator ri; - tree var; + unsigned j; + bitmap_iterator bj; if (MPT_SYMBOLS (mpt) == NULL) { @@ -552,14 +560,17 @@ verify_memory_partitions (void) goto err; } - FOR_EACH_REFERENCED_VAR_IN_BITMAP (MPT_SYMBOLS (mpt), var, ri) - if (pointer_set_insert (partitioned_syms, var)) - { - error ("Partitioned symbols should belong to exactly one " - "partition"); - debug_variable (var); - goto err; - } + EXECUTE_IF_SET_IN_BITMAP (MPT_SYMBOLS (mpt), 0, j, bj) + { + tree var = referenced_var (j); + if (pointer_set_insert (partitioned_syms, var)) + { + error ("Partitioned symbols should belong to exactly one " + "partition"); + debug_variable (var); + goto err; + } + } } pointer_set_destroy (partitioned_syms); @@ -763,6 +774,24 @@ int_tree_map_hash (const void *item) return ((const struct int_tree_map *)item)->uid; } +/* Return true if the DECL_UID in both trees are equal. */ + +int +uid_decl_map_eq (const void *va, const void *vb) +{ + const_tree a = (const_tree) va; + const_tree b = (const_tree) vb; + return (a->decl_minimal.uid == b->decl_minimal.uid); +} + +/* Hash a tree in a uid_decl_map. */ + +unsigned int +uid_decl_map_hash (const void *item) +{ + return ((const_tree)item)->decl_minimal.uid; +} + /* Return true if the uid in both int tree maps are equal. */ static int @@ -806,7 +835,8 @@ void init_tree_ssa (void) { cfun->gimple_df = GGC_CNEW (struct gimple_df); - cfun->gimple_df->referenced_vars = BITMAP_GGC_ALLOC (); + cfun->gimple_df->referenced_vars = htab_create_ggc (20, uid_decl_map_hash, + uid_decl_map_eq, NULL); cfun->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash, uid_ssaname_map_eq, NULL); cfun->gimple_df->var_anns = htab_create_ggc (20, var_ann_hash, @@ -863,6 +893,7 @@ delete_tree_ssa (void) ggc_free (var->base.ann); var->base.ann = NULL; } + htab_delete (gimple_referenced_vars (cfun)); cfun->gimple_df->referenced_vars = NULL; fini_ssanames (); |