diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-23 16:40:55 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-23 16:40:55 +0000 |
commit | bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489 (patch) | |
tree | c50f816477650b4e3cbb25b84c72aae959f07b1b /gcc/ada/gcc-interface/trans.c | |
parent | 3682dc97d6bf818e4c95c734e4d5588a9d9a4cda (diff) | |
download | gcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.zip gcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.tar.gz gcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.tar.bz2 |
gimplify.c (gimplify_modify_expr_rhs): Do not do a direct assignment from the constructor either if the target is volatile.
* gimplify.c (gimplify_modify_expr_rhs) <VAR_DECL>: Do not do a direct
assignment from the constructor either if the target is volatile.
ada/
* einfo.ads (Is_True_Constant): Lift restriction on atomic objects.
* sinfo.ads (Object Declaration): Likewise.
(Assignment Statement): Likewise.
* freeze.adb (Expand_Atomic_Aggregate): Remove useless test.
Do not force Is_True_Constant to false on the temporary.
(Freeze_Entity): Do not force Is_True_Constant to false on names on
the RHS of object declarations.
* gcc-interface/trans.c (lvalue_required_p) <N_Object_Declaration>:
New case. Return 1 if the object is atomic.
<N_Assignment_Statement>: Likewise.
From-SVN: r146652
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 275017c..de6ac0b 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -723,6 +723,18 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, int aliased) (Underlying_Type (Etype (Name (gnat_parent)))) || Nkind (Name (gnat_parent)) == N_Identifier); + case N_Object_Declaration: + /* We cannot use a constructor if this is an atomic object because + the actual assignment might end up being done component-wise. */ + return Is_Composite_Type (Underlying_Type (Etype (gnat_node))) + && Is_Atomic (Defining_Entity (gnat_parent)); + + case N_Assignment_Statement: + /* We cannot use a constructor if the LHS is an atomic object because + the actual assignment might end up being done component-wise. */ + return Is_Composite_Type (Underlying_Type (Etype (gnat_node))) + && Is_Atomic (Entity (Name (gnat_parent))); + default: return 0; } |