aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-05-27 17:57:01 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-05-27 17:57:01 +0000
commite590690ef23053ddbd5b32c119f403f418a02d6a (patch)
tree870c6543515c3bb53f9a7eea4a01b95a86580fe5 /gcc
parentb6840fb7da103cb5b722b50e5fc681b573bd8030 (diff)
downloadgcc-e590690ef23053ddbd5b32c119f403f418a02d6a.zip
gcc-e590690ef23053ddbd5b32c119f403f418a02d6a.tar.gz
gcc-e590690ef23053ddbd5b32c119f403f418a02d6a.tar.bz2
decl.c (gnat_to_gnu_entity): Move down code applying atomic checks to the object.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Move down code applying atomic checks to the object. From-SVN: r223767
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c13
2 files changed, 9 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d9fbe97..98d5ea9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Move down
+ code applying atomic checks to the object.
+
2015-05-27 Robert Dewar <dewar@adacore.com>
* sem_aux.adb: Minor rewording.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4a8c4d0..da352c2 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -881,15 +881,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
check_ok_for_atomic_type (gnu_inner, gnat_entity, true);
}
- /* Now check if the type of the object allows atomic access. Note
- that we must test the type, even if this object has size and
- alignment to allow such access, because we will be going inside
- the padded record to assign to the object. We could fix this by
- always copying via an intermediate value, but it's not clear it's
- worth the effort. */
- if (Is_Atomic_Or_VFA (gnat_entity))
- check_ok_for_atomic_type (gnu_type, gnat_entity, false);
-
/* If this is an aliased object with an unconstrained nominal subtype,
make a type that includes the template. */
if (Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
@@ -955,6 +946,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
debug_info_p, gnat_entity);
}
+ /* Now check if the type of the object allows atomic access. */
+ if (Is_Atomic_Or_VFA (gnat_entity))
+ check_ok_for_atomic_type (gnu_type, gnat_entity, false);
+
/* If this is a renaming, avoid as much as possible to create a new
object. However, in some cases, creating it is required because
renaming can be applied to objects that are not names in Ada.