aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-08-08 12:56:51 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-08-08 12:56:51 -0400
commit5755cd3808b7ffb637991e6537a69d1bdae4cffb (patch)
treeaebee6fdf45e18a5266d6c228d8bc47d74e8f54e /gcc/alias.c
parent0f0138b6b2669803f26f9a19adce9da9c8eb9911 (diff)
downloadgcc-5755cd3808b7ffb637991e6537a69d1bdae4cffb.zip
gcc-5755cd3808b7ffb637991e6537a69d1bdae4cffb.tar.gz
gcc-5755cd3808b7ffb637991e6537a69d1bdae4cffb.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. * function.c (gen_mem_addressof): Calculate the alias set before touching the RTL. From-SVN: r44720
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 a1204a2..a79589f 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)