aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-08-07 07:13:54 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-08-07 07:13:54 -0400
commit1b81b7891b82b0d5bbb5ff760423f3d6ad3c701e (patch)
treeef73e08c581a7b17aa02f7f5b1d52c00bd9101c1 /gcc/alias.c
parente13ef1e287aa2116c30d849b4de3d12313322ccc (diff)
downloadgcc-1b81b7891b82b0d5bbb5ff760423f3d6ad3c701e.zip
gcc-1b81b7891b82b0d5bbb5ff760423f3d6ad3c701e.tar.gz
gcc-1b81b7891b82b0d5bbb5ff760423f3d6ad3c701e.tar.bz2
alias.c (get_alias_set): Return a previously calculated alias set for a VAR_DECL.
* alias.c (get_alias_set): Return a previously calculated alias set for a VAR_DECL. From-SVN: r44683
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 e741718..a529a01 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -527,6 +527,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)