summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-11 18:01:54 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-11 18:01:54 +0000
commitc5d44e2fbe97b15dc79f213a19223f75c22bcf8e (patch)
tree0f32dcc7135957b2a24b097ca12ea0850be9f8be /gcc/alias.c
parent6adfb8f86caa33f61d6ff2aa1aa81f3768beabbf (diff)
downloadgcc-c5d44e2fbe97b15dc79f213a19223f75c22bcf8e.tar.gz
2002-03-06 Dan Nicolaescu <dann@ics.uci.edu>
Daniel Berlin <dan@dberlin.org> C++ alias analysis improvement. * alias.c (record_component_aliases): Record aliases for base classes too. * cp/cp-lang.c (ok_to_generate_alias_set_for_type): New function. (cxx_get_alias_set): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50587 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 5d017eb73c9..9b46fe1be52 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -679,6 +679,17 @@ record_component_aliases (type)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
+ /* Recursively record aliases for the base classes, if there are any */
+ if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL)
+ {
+ int i;
+ for (i = 0; i < TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type)); i++)
+ {
+ tree binfo = TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), i);
+ record_alias_subset (superset,
+ get_alias_set (BINFO_TYPE (binfo)));
+ }
+ }
for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL && ! DECL_NONADDRESSABLE_P (field))
record_alias_subset (superset, get_alias_set (TREE_TYPE (field)));