aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-02-25 01:56:14 +0000
committerRichard Henderson <rth@redhat.com>2005-02-25 01:56:14 +0000
commit9af485bb2492f32a4e78f637e1ae3fc34f14b5e1 (patch)
treeb58b5ccee1b1558b4d717318e5580b0ffeb360a2 /gcc/tree-sra.c
parent71e2639ee749e7d450936f8c17d3593d7f9e5ce8 (diff)
PR tree-opt/20127
* tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from the type. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@95530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 15109045375..267655d4bdf 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1116,6 +1116,12 @@ instantiate_element (struct sra_elt *elt)
DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (base);
DECL_ARTIFICIAL (var) = 1;
+ if (TREE_THIS_VOLATILE (elt->type))
+ {
+ TREE_THIS_VOLATILE (var) = 1;
+ TREE_SIDE_EFFECTS (var) = 1;
+ }
+
if (DECL_NAME (base) && !DECL_IGNORED_P (base))
{
char *pretty_name = build_element_name (elt);