summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-22 14:53:20 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-22 14:53:20 +0000
commit6db5fcbd6be9bf802f5649fcb302f40315d5e052 (patch)
tree4bd5e8caffe00fb80b6c35339582c999062a2e3f /gcc/explow.c
parent3612339f889f1ee7385b52a5ef2b3b7435fba1ca (diff)
downloadgcc-6db5fcbd6be9bf802f5649fcb302f40315d5e052.tar.gz
* explow.c (set_mem_attributes): Avoid returning a bogus alias set
from a new MEM. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45108 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 3a7716fd265..d01067de7ff 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -670,7 +670,16 @@ set_mem_attributes (ref, t, objectp)
here, because, in C and C++, the fact that a location is accessed
through a const expression does not mean that the value there can
never change. */
+
+ /* If we have already set DECL_RTL = ref, get_alias_set will get the
+ wrong answer, as it assumes that DECL_RTL already has the right alias
+ info. Callers should not set DECL_RTL until after the call to
+ set_mem_attributes. */
+ if (DECL_P (t) && ref == DECL_RTL_IF_SET (t))
+ abort ();
+
set_mem_alias_set (ref, get_alias_set (t));
+
MEM_VOLATILE_P (ref) = TYPE_VOLATILE (type);
MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);