diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-12 08:07:57 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-12 08:07:57 +0000 |
commit | f532437e7ae8174e7fcfb6886c90defb20394bfa (patch) | |
tree | 27fa7e139702c2af55d394f06a68e220c7210e1b /gcc/gimplify.c | |
parent | dc254a612ba302ae7d6a5c2e5770658a7307044a (diff) | |
download | gcc-f532437e7ae8174e7fcfb6886c90defb20394bfa.tar.gz |
PR c++/36688
* gimplify.c (gimplify_modify_expr_rhs): Test TREE_READONLY
on the VAR_DECL instead of TYPE_READONLY on its type.
* g++.dg/init/const6.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139004 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index f22111d4cd7..753aa591e40 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3913,7 +3913,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, /* If we're assigning from a constant constructor, move the constructor expression to the RHS of the MODIFY_EXPR. */ if (DECL_INITIAL (*from_p) - && TYPE_READONLY (TREE_TYPE (*from_p)) + && TREE_READONLY (*from_p) && !TREE_THIS_VOLATILE (*from_p) && TREE_CODE (DECL_INITIAL (*from_p)) == CONSTRUCTOR) { |