]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* decl.c (gnat_to_gnu_entity) <object>: Make again the type of an
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Sep 2007 06:29:32 +0000 (06:29 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Sep 2007 06:29:32 +0000 (06:29 +0000)
object covered by 13.3(19) volatile.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128538 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/decl.c

index 65eeced034f64d8990443cb92471aa9ef5b12f24..695d4485de3ee92ef4b560b2be25b962d7e22277 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * decl.c (gnat_to_gnu_entity) <object>: Make again the type of an
+       object covered by 13.3(19) volatile.
+
 2007-09-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/26797
index 4b3edce40a9504119e12dcb181c5786779d4af54..c625afb695bf9e90d1cfd7d516c2b0d25002e30a 100644 (file)
@@ -728,12 +728,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
                                   "PAD", false, definition, true);
 
-       /* Make a volatile version of this object's type if we are to
-          make the object volatile.  Note that 13.3(19) says that we
-          should treat other types of objects as volatile as well.  */
+       /* Make a volatile version of this object's type if we are to make
+          the object volatile.  We also interpret 13.3(19) conservatively
+          and disallow any optimizations for an object covered by it.  */
        if ((Treat_As_Volatile (gnat_entity)
             || Is_Exported (gnat_entity)
-            || Is_Imported (gnat_entity))
+            || Is_Imported (gnat_entity)
+            || Present (Address_Clause (gnat_entity)))
            && !TYPE_VOLATILE (gnu_type))
          gnu_type = build_qualified_type (gnu_type,
                                           (TYPE_QUALS (gnu_type)