summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-08 16:56:51 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-08 16:56:51 +0000
commitafce1f578206e99e0b3a1774728304629f42ada0 (patch)
treeaebee6fdf45e18a5266d6c228d8bc47d74e8f54e /gcc/alias.c
parent483f30d9e207f75b774dddf9a1b5422b794cfb3a (diff)
downloadgcc-afce1f578206e99e0b3a1774728304629f42ada0.tar.gz
* alias.c (get_alias_set): Return a previously calculated
alias set for a VAR_DECL. * function.c (gen_mem_addressof): Calculate the alias set before touching the RTL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index a1204a2eac9..a79589f0dcc 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -526,6 +526,13 @@ get_alias_set (t)
return 0;
}
+ /* If we've already determined the alias set for this decl, just
+ return it. This is necessary for C++ anonymous unions, whose
+ component variables don't look like union members (boo!). */
+ if (TREE_CODE (t) == VAR_DECL
+ && DECL_RTL_SET_P (t) && GET_CODE (DECL_RTL (t)) == MEM)
+ return MEM_ALIAS_SET (DECL_RTL (t));
+
/* Give the language another chance to do something special. */
if (orig_t != t
&& (set = lang_get_alias_set (t)) != -1)