summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-21 07:10:01 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-21 07:10:01 +0000
commitaac684f2c78efe82304307b46f784da84d76cded (patch)
tree101c901c474d666b5ad5859c560a2ad57d0666ff
parente7b92021fb5f38fc0dfdea14a41bcefe44b74768 (diff)
downloadppe42-gcc-aac684f2c78efe82304307b46f784da84d76cded.tar.gz
ppe42-gcc-aac684f2c78efe82304307b46f784da84d76cded.zip
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Do not make
constant objects covered by 13.3(19) volatile. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146468 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c13
2 files changed, 10 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0e48f7848b1..d771e988a3e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Do not make
+ constant objects covered by 13.3(19) volatile.
+
+2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/utils.c (create_type_decl): Do not pass declarations
of dummy fat pointer types to the debug back-end.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 390d458f701..18ebeff76ab 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -967,15 +967,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* 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. */
+ and disallow any optimizations for such a non-constant object. */
if ((Treat_As_Volatile (gnat_entity)
- || (Is_Exported (gnat_entity)
- /* Exclude exported constants created by the compiler,
- which should boil down to static dispatch tables and
- make it possible to put them in read-only memory. */
- && (Comes_From_Source (gnat_entity) || !const_flag))
- || Is_Imported (gnat_entity)
- || Present (Address_Clause (gnat_entity)))
+ || (!const_flag
+ && (Is_Exported (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)
OpenPOWER on IntegriCloud