(expand_expr, case INDIRECT_REF): Set RTX_UNCHANGING_P if both

TREE_READONLY and TREE_STATIC set.

From-SVN: r9591
This commit is contained in:
Richard Kenner 1995-05-08 17:59:41 -04:00
parent d949d5dfde
commit 1125706fe4

View File

@ -4555,11 +4555,13 @@ expand_expr (exp, target, tmode, modifier)
&& AGGREGATE_TYPE_P (TREE_TYPE (exp2))))
MEM_IN_STRUCT_P (temp) = 1;
MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp) | flag_volatile;
#if 0 /* It is incorrect to set RTX_UNCHANGING_P here, because the fact that
a location is accessed through a pointer to const does not mean
that the value there can never change. */
RTX_UNCHANGING_P (temp) = TREE_READONLY (exp);
#endif
/* It is incorrect to set RTX_UNCHANGING_P from TREE_READONLY
here, because, in C and C++, the fact that a location is accessed
through a pointer to const does not mean that the value there can
never change. Languages where it can never change should
also set TREE_STATIC. */
RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) | TREE_STATIC (exp);
return temp;
}