aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.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/function.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/function.c')
-rw-r--r--gcc/function.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 0c4d712..5a169c6 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2857,6 +2857,9 @@ gen_mem_addressof (reg, decl)
rtx r = gen_rtx_ADDRESSOF (Pmode, gen_reg_rtx (GET_MODE (reg)),
REGNO (reg), decl);
+ /* Calculate this before we start messing with decl's RTL. */
+ HOST_WIDE_INT set = get_alias_set (decl);
+
/* If the original REG was a user-variable, then so is the REG whose
address is being taken. Likewise for unchanging. */
REG_USERVAR_P (XEXP (r, 0)) = REG_USERVAR_P (reg);
@@ -2874,7 +2877,7 @@ gen_mem_addressof (reg, decl)
PUT_MODE (reg, decl_mode);
MEM_VOLATILE_P (reg) = TREE_SIDE_EFFECTS (decl);
MEM_SET_IN_STRUCT_P (reg, AGGREGATE_TYPE_P (type));
- set_mem_alias_set (reg, get_alias_set (decl));
+ set_mem_alias_set (reg, set);
if (TREE_USED (decl) || DECL_INITIAL (decl) != 0)
fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), 0);