summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-02 12:39:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-02 12:39:39 +0000
commit2fb581a932680f7c9031a388d83fd9461ae5aff7 (patch)
tree3fc3c7221a155722969c9d76ed30e1b1127f4ad2 /gcc/tree-dfa.c
parentc643c550aace860f7d2ab17015f684444cb88c53 (diff)
downloadgcc-2fb581a932680f7c9031a388d83fd9461ae5aff7.tar.gz
2008-06-02 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r136272 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@136278 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 7e4bb7681b7..af167492de6 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -142,33 +142,14 @@ var_ann_t
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;
}
@@ -765,8 +746,20 @@ remove_referenced_var (tree var)
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,