This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: spec2000 regression
>>>>> "Jason" == Jason Merrill <jason_merrill@redhat.com> writes:
>> Instead, I'd abort in the first case and fix all the callers.
> Makes sense.
Applied:
2001-08-22 Jason Merrill <jason_merrill@redhat.com>
* explow.c (set_mem_attributes): Avoid returning a bogus alias set
from a new MEM.
*** explow.c.~1~ Wed Aug 22 00:11:17 2001
--- explow.c Tue Aug 21 14:04:49 2001
*************** set_mem_attributes (ref, t, objectp)
*** 670,676 ****
--- 670,685 ----
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);