From 945891207919f9486961857c5de8db42a4771687 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Mon, 11 Apr 2005 20:15:33 +0000 Subject: [PATCH] re PR tree-optimization/20926 (ICE: tree check, in recent builds) 2005-04-11 Daniel Berlin Fix PR tree-optimization/20926 * tree-ssa-alias.c (add_type_alias): Handle subvars. From-SVN: r97982 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-alias.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0818b49..beb69e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-04-11 Daniel Berlin + + Fix PR tree-optimization/20926 + + * tree-ssa-alias.c (add_type_alias): Handle subvars. + 2005-04-11 Devang Patel * config/rs6000.c (rs6000_emit_vector_select): Fix vector select diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 0f70017..7d8e783 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2704,6 +2704,7 @@ add_type_alias (tree ptr, tree var) varray_type aliases; tree tag; var_ann_t ann = var_ann (ptr); + subvar_t svars; if (ann->type_mem_tag == NULL_TREE) { @@ -2748,7 +2749,18 @@ found_tag: for PTR's type tag. */ gcc_assert (var_ann (var)->type_mem_tag == NOT_A_TAG); tag = ann->type_mem_tag; - add_may_alias (tag, var); + + /* If VAR has subvars, add the subvars to the tag instead of the + actual var. */ + if (var_can_have_subvars (var) + && (svars = get_subvars_for_var (var))) + { + subvar_t sv; + for (sv = svars; sv; sv = sv->next) + add_may_alias (tag, sv->var); + } + else + add_may_alias (tag, var); /* TAG and its set of aliases need to be marked for renaming. */ mark_sym_for_renaming (tag); -- 2.7.4