aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-06-12 11:17:09 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-06-12 11:17:09 +0000
commit0ea834c1156305a0a2a64598ac610f4d0a232431 (patch)
treed21b44c3d97585893be527424364e18cc1be78b1 /gcc
parentc50174e7298e70ccbf96a4a581efed4656435871 (diff)
downloadgcc-0ea834c1156305a0a2a64598ac610f4d0a232431.zip
gcc-0ea834c1156305a0a2a64598ac610f4d0a232431.tar.gz
gcc-0ea834c1156305a0a2a64598ac610f4d0a232431.tar.bz2
expr.c (store_field): Don't set MEM_ALIAS_SET for a field in a structure at a variable address.
* expr.c (store_field): Don't set MEM_ALIAS_SET for a field in a structure at a variable address. From-SVN: r43256
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 971b753..f3fff9f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-12 Mark Mitchell <mark@codesourcery.com>
+
+ * expr.c (store_field): Don't set MEM_ALIAS_SET for a field
+ in a structure at a variable address.
+
2001-06-12 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/gcov.texi: Use more logical markup.
diff --git a/gcc/expr.c b/gcc/expr.c
index a7b0ff4..9666568 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5327,7 +5327,16 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
(bitpos
/ BITS_PER_UNIT))));
MEM_SET_IN_STRUCT_P (to_rtx, 1);
- MEM_ALIAS_SET (to_rtx) = alias_set;
+ /* If the address of the structure varies, then it might be on
+ the stack. And, stack slots may be shared across scopes.
+ So, two different structures, of different types, can end up
+ at the same location. We will give the structures alias set
+ zero; here we must be careful not to give non-zero alias sets
+ to their fields. */
+ if (!rtx_varies_p (addr, /*for_alias=*/0))
+ MEM_ALIAS_SET (to_rtx) = alias_set;
+ else
+ MEM_ALIAS_SET (to_rtx) = 0;
return store_expr (exp, to_rtx, value_mode != VOIDmode);
}