From bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 23 Apr 2009 16:40:55 +0000 Subject: 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) : 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) : New case. Return 1 if the object is atomic. : Likewise. From-SVN: r146652 --- gcc/ada/gcc-interface/trans.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/ada/gcc-interface') 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; } -- cgit v1.1