diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-dfa.c | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f28f013..2d0e93c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-11-08 Richard Guenther <rguenther@suse.de> + + * tree-dfa.c (remove_referenced_var): If removing a + variable which has subvars, also remove those from + the referenced vars. Do not create a variable annotation. + 2007-11-08 Bob Wilson <bob.wilson@acm.org> * config/xtensa/xtensa.c (xtensa_expand_prologue): Remove first diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 6ee90d7..4880e83 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -751,10 +751,22 @@ remove_referenced_var (tree var) struct tree_decl_minimal in; void **loc; unsigned int uid = DECL_UID (var); + subvar_t sv; + + /* If we remove a var, we should also remove its subvars, as we kill + their parent var and its annotation. */ + if (var_can_have_subvars (var) + && (sv = get_subvars_for_var (var))) + { + unsigned int i; + tree subvar; + for (i = 0; VEC_iterate (tree, sv, i, subvar); ++i) + remove_referenced_var (subvar); + } clear_call_clobbered (var); - v_ann = get_var_ann (var); - ggc_free (v_ann); + if ((v_ann = var_ann (var))) + ggc_free (v_ann); var->base.ann = NULL; gcc_assert (DECL_P (var)); in.uid = uid; |