summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-03 22:40:58 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-03 22:40:58 +0000
commit3846bf0cad1b5566578bb5904a027a82b71b3a3a (patch)
tree8ce0b0e15aa050323e8012a0063c5c522e24d2b1 /gcc/expr.c
parentfada5e3d8211e2ab58beb0d0e61425fdc44b0f29 (diff)
downloadgcc-3846bf0cad1b5566578bb5904a027a82b71b3a3a.tar.gz
* expr.c (store_constructor): Only set RTX_UNCHANGING_P for
read-only field if cleared is 0. * gcc.dg/20031202-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74251 138bc75d-0d04-0410-961f-82ee72b054a4
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 c01378515f6..2f58cd2a236 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);