Commit 1125706f by Richard Kenner

(expand_expr, case INDIRECT_REF): Set RTX_UNCHANGING_P if both

TREE_READONLY and TREE_STATIC set.

From-SVN: r9591
parent d949d5df
...@@ -4555,11 +4555,13 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4555,11 +4555,13 @@ expand_expr (exp, target, tmode, modifier)
&& AGGREGATE_TYPE_P (TREE_TYPE (exp2)))) && AGGREGATE_TYPE_P (TREE_TYPE (exp2))))
MEM_IN_STRUCT_P (temp) = 1; MEM_IN_STRUCT_P (temp) = 1;
MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp) | flag_volatile; 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 /* It is incorrect to set RTX_UNCHANGING_P from TREE_READONLY
that the value there can never change. */ here, because, in C and C++, the fact that a location is accessed
RTX_UNCHANGING_P (temp) = TREE_READONLY (exp); through a pointer to const does not mean that the value there can
#endif 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; return temp;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment