diff options
author | Richard Guenther <rguenther@suse.de> | 2008-05-28 13:54:05 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-05-28 13:54:05 +0000 |
commit | 540f6bda9926d60d7691fc4a21fe78338b450952 (patch) | |
tree | bbf97b3fc675101df94246164a86835ad4504952 /gcc/tree-dfa.c | |
parent | 00ea95170b661191fffee460554c33f075bcc733 (diff) | |
download | gcc-540f6bda9926d60d7691fc4a21fe78338b450952.zip gcc-540f6bda9926d60d7691fc4a21fe78338b450952.tar.gz gcc-540f6bda9926d60d7691fc4a21fe78338b450952.tar.bz2 |
re PR tree-optimization/36291 (GCC is slow and memory-hungry building sipQtGuipart.cpp)
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.
From-SVN: r136095
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 7e4bb76..af16749 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, |