+2008-05-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36291
+ * tree-flow. h (struct gimple_df): Remove var_anns member.
+ * tree-flow-inline.h (gimple_var_anns): Remove.
+ (var_ann): Simplify.
+ * tree-dfa.c (create_var_ann): Simplify.
+ (remove_referenced_var): Clear alias info from var_anns of globals.
+ * tree-ssa.c (init_tree_ssa): Do not allocate var_anns.
+ (delete_tree_ssa): Clear alias info from var_anns of globals.
+ Do not free var_anns.
+ (var_ann_eq): Remove.
+ (var_ann_hash): Likewise.
+
2008-05-28 Mark Shinwell <shinwell@codesourcery.com>
* config/mips/mips.c (mips_cpu_info_table): Add loongson2e
create_var_ann (tree t)
{
var_ann_t ann;
- struct static_var_ann_d *sann = NULL;
gcc_assert (t);
gcc_assert (DECL_P (t));
gcc_assert (!t->base.ann || t->base.ann->common.type == VAR_ANN);
- if (!MTAG_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
- {
- sann = GGC_CNEW (struct static_var_ann_d);
- ann = &sann->ann;
- }
- else
- ann = GGC_CNEW (struct var_ann_d);
-
+ ann = GGC_CNEW (struct var_ann_d);
ann->common.type = VAR_ANN;
-
- if (!MTAG_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
- {
- void **slot;
- sann->uid = DECL_UID (t);
- slot = htab_find_slot_with_hash (gimple_var_anns (cfun),
- t, DECL_UID (t), INSERT);
- gcc_assert (!*slot);
- *slot = sann;
- }
- else
- t->base.ann = (tree_ann_t) ann;
+ t->base.ann = (tree_ann_t) ann;
return ann;
}
clear_call_clobbered (var);
if ((v_ann = var_ann (var)))
- ggc_free (v_ann);
- var->base.ann = NULL;
+ {
+ /* Preserve var_anns of globals, but clear their alias info. */
+ if (MTAG_P (var)
+ || (!TREE_STATIC (var) && !DECL_EXTERNAL (var)))
+ {
+ ggc_free (v_ann);
+ var->base.ann = NULL;
+ }
+ else
+ {
+ v_ann->mpt = NULL_TREE;
+ v_ann->symbol_mem_tag = NULL_TREE;
+ }
+ }
gcc_assert (DECL_P (var));
in.uid = uid;
loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
return fun->gimple_df->nonlocal_all;
}
-/* Hashtable of variables annotations. Used for static variables only;
- local variables have direct pointer in the tree node. */
-static inline htab_t
-gimple_var_anns (const struct function *fun)
-{
- return fun->gimple_df->var_anns;
-}
-
/* Initialize the hashtable iterator HTI to point to hashtable TABLE */
static inline void *
{
var_ann_t ann;
- if (!MTAG_P (t)
- && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
- {
- struct static_var_ann_d *sann
- = ((struct static_var_ann_d *)
- htab_find_with_hash (gimple_var_anns (cfun), t, DECL_UID (t)));
- if (!sann)
- return NULL;
- ann = &sann->ann;
- }
- else
- {
- if (!t->base.ann)
- return NULL;
- ann = (var_ann_t) t->base.ann;
- }
+ if (!t->base.ann)
+ return NULL;
+ ann = (var_ann_t) t->base.ann;
gcc_assert (ann->common.type == VAR_ANN);
struct ssa_operands ssa_operands;
- /* Hashtable of variables annotations. Used for static variables only;
- local variables have direct pointer in the tree node. */
- htab_t GTY((param_is (struct static_var_ann_d))) var_anns;
-
/* Memory reference statistics collected during alias analysis.
This information is used to drive the memory partitioning
heuristics in compute_memory_partitions. */
return ((const_tree)item)->decl_minimal.uid;
}
-/* Return true if the uid in both int tree maps are equal. */
-
-static int
-var_ann_eq (const void *va, const void *vb)
-{
- const struct static_var_ann_d *a = (const struct static_var_ann_d *) va;
- const_tree const b = (const_tree) vb;
- return (a->uid == DECL_UID (b));
-}
-
-/* Hash a UID in a int_tree_map. */
-
-static unsigned int
-var_ann_hash (const void *item)
-{
- return ((const struct static_var_ann_d *)item)->uid;
-}
-
/* Return true if the DECL_UID in both trees are equal. */
static int
uid_decl_map_eq, NULL);
fn->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash,
uid_ssaname_map_eq, NULL);
- fn->gimple_df->var_anns = htab_create_ggc (20, var_ann_hash,
- var_ann_eq, NULL);
fn->gimple_df->call_clobbered_vars = BITMAP_GGC_ALLOC ();
fn->gimple_df->addressable_vars = BITMAP_GGC_ALLOC ();
init_ssanames (fn, 0);
set_phi_nodes (bb, NULL);
}
- /* Remove annotations from every referenced variable. */
+ /* Remove annotations from every referenced local variable. */
FOR_EACH_REFERENCED_VAR (var, rvi)
{
+ if (!MTAG_P (var)
+ && (TREE_STATIC (var) || DECL_EXTERNAL (var)))
+ {
+ var_ann (var)->mpt = NULL_TREE;
+ var_ann (var)->symbol_mem_tag = NULL_TREE;
+ continue;
+ }
if (var->base.ann)
ggc_free (var->base.ann);
var->base.ann = NULL;
htab_delete (cfun->gimple_df->default_defs);
cfun->gimple_df->default_defs = NULL;
- htab_delete (cfun->gimple_df->var_anns);
- cfun->gimple_df->var_anns = NULL;
cfun->gimple_df->call_clobbered_vars = NULL;
cfun->gimple_df->addressable_vars = NULL;
cfun->gimple_df->modified_noreturn_calls = NULL;