This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix tree-opt/20127


Obvious, after the fact.  Tested on i686-linux.


r~


        * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from
        the type.

Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.52
diff -u -p -d -r2.52 tree-sra.c
--- tree-sra.c	17 Feb 2005 16:19:42 -0000	2.52
+++ tree-sra.c	25 Feb 2005 01:54:09 -0000
@@ -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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]