summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-08 22:35:44 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-08 22:35:44 +0000
commitc9fc374668cba0124a471fe7ceb7df364035bb8e (patch)
tree7af2a0401d9232f0559d57993204c20f466576e1 /gcc/tree-dfa.c
parenta35ed56c546db56254d089d76e106e7c68604f91 (diff)
downloadgcc-c9fc374668cba0124a471fe7ceb7df364035bb8e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 6ee90d74617..4880e83618e 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;