aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-10-25 12:55:16 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-10-25 08:55:16 -0400
commit10b76d739543e54113cdb8755ba624c03bae4239 (patch)
tree0f9f09ded135324a3c1a35af13611e762d6e0cf3 /gcc/expr.c
parent9fb60a0d1a7af546cce200d38315019b1e026a89 (diff)
downloadgcc-10b76d739543e54113cdb8755ba624c03bae4239.zip
gcc-10b76d739543e54113cdb8755ba624c03bae4239.tar.gz
gcc-10b76d739543e54113cdb8755ba624c03bae4239.tar.bz2
alias.c (can_address_p): No longer static.
* alias.c (can_address_p): No longer static. * emit-rtl.c (get_mem_attrs): New parameter, MODE; all callers changed. Return 0 if all parameters are default values. (set_mem_attributes): Set MEM_KEEP_ALIAS_SET_P. (adjust_address_1): Try harder to compute a size. * expr.c (expand_assignment, store_constructor): If can't address, set MEM_KEEP_ALIAS_SET_P. (store_constructor_field): Don't change set if MEM_KEEP_ALIAS_SET_P. (store_field): Likewise. (store_constructor): Simplify call to store_constructor_field. * expr.h (can_address_p): New declaration. * gensupport.c (gen_rtx_CONST_INT): New function. * rtl.h (MEM_KEEP_ALIAS_SET_P): New macro. (MEM_SIZE): Get size from mode, if not set and not BLKmode. (MEM_COPY_ATTRIBUTES): Copy MEM_KEEP_ALIAS_SET_P. From-SVN: r46487
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 3eebaa2..d738d2d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3841,6 +3841,12 @@ expand_assignment (to, from, want_value, suggest_reg)
}
else
{
+ if (! can_address_p (to))
+ {
+ to_rtx = copy_rtx (to_rtx);
+ MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
+ }
+
result = store_field (to_rtx, bitsize, bitpos, mode1, from,
(want_value
/* Spurious cast for HPUX compiler. */
@@ -4479,7 +4485,9 @@ store_constructor_field (target, bitsize, bitpos,
set, if required. */
if (bitpos != 0)
align = MIN (align, (unsigned int) bitpos & - bitpos);
- if (GET_CODE (target) == MEM)
+
+ if (GET_CODE (target) == MEM && ! MEM_KEEP_ALIAS_SET_P (target)
+ && MEM_ALIAS_SET (target) != 0)
set_mem_alias_set (target, alias_set);
store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
@@ -4681,12 +4689,17 @@ store_constructor (exp, target, align, cleared, size)
mode = word_mode;
}
#endif
+
+ if (GET_CODE (to_rtx) == MEM && !MEM_KEEP_ALIAS_SET_P (to_rtx)
+ && DECL_NONADDRESSABLE_P (field))
+ {
+ to_rtx = copy_rtx (to_rtx);
+ MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
+ }
+
store_constructor_field (to_rtx, bitsize, bitpos, mode,
TREE_VALUE (elt), type, align, cleared,
- (DECL_NONADDRESSABLE_P (field)
- && GET_CODE (to_rtx) == MEM)
- ? MEM_ALIAS_SET (to_rtx)
- : get_alias_set (TREE_TYPE (field)));
+ get_alias_set (TREE_TYPE (field)));
}
}
else if (TREE_CODE (type) == ARRAY_TYPE)
@@ -4824,11 +4837,18 @@ store_constructor (exp, target, align, cleared, size)
for (; lo <= hi; lo++)
{
bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
+
+ if (GET_CODE (target) == MEM
+ && !MEM_KEEP_ALIAS_SET_P (target)
+ && TYPE_NONALIASED_COMPONENT (type))
+ {
+ target = copy_rtx (target);
+ MEM_KEEP_ALIAS_SET_P (target) = 1;
+ }
+
store_constructor_field
(target, bitsize, bitpos, mode, value, type, align,
- cleared,
- TYPE_NONALIASED_COMPONENT (type)
- ? MEM_ALIAS_SET (target) : get_alias_set (elttype));
+ cleared, get_alias_set (elttype));
}
}
else
@@ -4916,11 +4936,15 @@ store_constructor (exp, target, align, cleared, size)
else
bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1));
+ if (GET_CODE (target) == MEM && !MEM_KEEP_ALIAS_SET_P (target)
+ && TYPE_NONALIASED_COMPONENT (type))
+ {
+ target = copy_rtx (target);
+ MEM_KEEP_ALIAS_SET_P (target) = 1;
+ }
+
store_constructor_field (target, bitsize, bitpos, mode, value,
type, align, cleared,
- TYPE_NONALIASED_COMPONENT (type)
- && GET_CODE (target) == MEM
- ? MEM_ALIAS_SET (target) :
get_alias_set (elttype));
}
@@ -5329,7 +5353,8 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
bitpos / BITS_PER_UNIT));
MEM_SET_IN_STRUCT_P (to_rtx, 1);
- set_mem_alias_set (to_rtx, alias_set);
+ if (!MEM_KEEP_ALIAS_SET_P (to_rtx) && MEM_ALIAS_SET (to_rtx) != 0)
+ set_mem_alias_set (to_rtx, alias_set);
return store_expr (exp, to_rtx, value_mode != VOIDmode);
}