aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2003-12-03 23:40:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2003-12-03 23:40:58 +0100
commit8ecc63eb275e8f67a25c1606abb6ae7231ae724f (patch)
tree8ce0b0e15aa050323e8012a0063c5c522e24d2b1 /gcc/expr.c
parent26d86d940ebeffe2e360292bbba54a7d6eb33ef5 (diff)
downloadgcc-8ecc63eb275e8f67a25c1606abb6ae7231ae724f.zip
gcc-8ecc63eb275e8f67a25c1606abb6ae7231ae724f.tar.gz
gcc-8ecc63eb275e8f67a25c1606abb6ae7231ae724f.tar.bz2
expr.c (store_constructor): Only set RTX_UNCHANGING_P for read-only field if cleared is 0.
* expr.c (store_constructor): Only set RTX_UNCHANGING_P for read-only field if cleared is 0. * gcc.dg/20031202-1.c: New test. From-SVN: r74251
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index c013785..2f58cd2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4643,7 +4643,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
highest_pow2_factor (offset));
}
- if (TREE_READONLY (field))
+ /* If the constructor has been cleared, setting RTX_UNCHANGING_P
+ on the MEM might lead to scheduling the clearing after the
+ store. */
+ if (TREE_READONLY (field) && !cleared)
{
if (GET_CODE (to_rtx) == MEM)
to_rtx = copy_rtx (to_rtx);