aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-02-24 17:56:14 -0800
committerRichard Henderson <rth@gcc.gnu.org>2005-02-24 17:56:14 -0800
commit964a98317cdebd20f9d2f034068ee7246ce62ff8 (patch)
treeb58b5ccee1b1558b4d717318e5580b0ffeb360a2 /gcc/tree-sra.c
parent78796ad54b18ad6aa7433cb0a45f6665f85f9743 (diff)
downloadgcc-964a98317cdebd20f9d2f034068ee7246ce62ff8.zip
gcc-964a98317cdebd20f9d2f034068ee7246ce62ff8.tar.gz
gcc-964a98317cdebd20f9d2f034068ee7246ce62ff8.tar.bz2
re PR tree-optimization/20127 (wrong code for volatile struct members)
PR tree-opt/20127 * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from the type. From-SVN: r95530
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 1510904..267655d 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);