diff options
author | Richard Henderson <rth@redhat.com> | 2005-02-24 17:56:14 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-02-24 17:56:14 -0800 |
commit | 964a98317cdebd20f9d2f034068ee7246ce62ff8 (patch) | |
tree | b58b5ccee1b1558b4d717318e5580b0ffeb360a2 /gcc/tree-sra.c | |
parent | 78796ad54b18ad6aa7433cb0a45f6665f85f9743 (diff) | |
download | gcc-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.c | 6 |
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); |