re PR tree-optimization/20127 (wrong code for volatile struct members)
authorRichard Henderson <rth@redhat.com>
Fri, 25 Feb 2005 01:56:14 +0000 (17:56 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 25 Feb 2005 01:56:14 +0000 (17:56 -0800)
        PR tree-opt/20127
        * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from
        the type.

From-SVN: r95530

gcc/ChangeLog
gcc/tree-sra.c

index 36d0804bbd52da97d67239b8fdf33803dd908838..26aea68902a40af0cf5f80138c44e8b353825c67 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-24  Richard Henderson  <rth@redhat.com>
+
+       PR tree-opt/20127
+       * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from
+       the type.
+
 2005-02-24  Fariborz Jahanian <fjahanian@apple.com>
 
        * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Check for
index 1510904537538478dbabbd109a91fe0a0a095785..267655d4bdfabc328a5e599023ee36fd28c9086a 100644 (file)
@@ -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);