aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/gigi.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-05-25 20:18:44 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-05-25 20:18:44 +0000
commitf797c2b745ec8a1b5750900caf54c96dcbc904ca (patch)
tree79e475b241a12de74ed6db829e811d0c9aff7480 /gcc/ada/gcc-interface/gigi.h
parent2e24efd3f49524b05dfb198cd60205a7113b10a2 (diff)
downloadgcc-f797c2b745ec8a1b5750900caf54c96dcbc904ca.zip
gcc-f797c2b745ec8a1b5750900caf54c96dcbc904ca.tar.gz
gcc-f797c2b745ec8a1b5750900caf54c96dcbc904ca.tar.bz2
gigi.h (build_atomic_load): Adjust prototype.
* gcc-interface/gigi.h (build_atomic_load): Adjust prototype. (build_atomic_store): Likewise. (build_load_modify_store): Declare. (VECTOR_TYPE_P): Delete. * gcc-interface/decl.c (gnat_to_gnu_entity): Replace Is_Atomic with Is_Atomic_Or_VFA throughout. <E_Array_Type>: Build a variant of the XUA type instead of forcing TYPE_VOLATILE on it. <E_Array_Subtype>: Use the main variant of the base type. Do not force TYPE_VOLATILE on the type being built. <E_Record_Type>: Likewise. <E_Array_Subtype>: Likewise. <E_Subprogram_Type>: Rename local variable. Add Atomic qualifier in conjunction with Volatile on types if needed. Force BLKmode for by-ref types only at the end of the processing. Change qualifiers only after changing the mode of the type. Set TYPE_UNIVERSAL_ALIASING_P on the type directly. (check_ok_for_atomic_type): Issue specific error message for VFA. (gnat_to_gnu_component_type): Replace Is_Atomic with Is_Atomic_Or_VFA throughout. * gcc-interface/misc.c (gnat_get_alias_set): Test TYPE_UNIVERSAL_ALIASING_P on the type directly. * gcc-interface/trans.c (lvalue_required_p): Replace Is_Atomic with Is_Atomic_Or_VFA throughout. Add missing guard. (node_is_atomic): New predicate. (node_has_volatile_full_access): Likewise. (gnat_strip_type_conversion): New function. (outer_atomic_access_required_p): New predicate. (atomic_sync_required_p): Rename into... (atomic_access_required_p): ...this. Add SYNC parameter, scan the parent node first and then look for the atomic setting. Add support for Volatile_Full_Access. (Call_to_gnu): Add atomic_access and outer_atomic_access parameters and adjusts calls to above functions. Use load-modify-store sequence for updates of In/Out and Out parameters if required, as well as for moving the result to the target if required. Add couple of missing guards. (gnat_to_gnu): Adjust calls to above functions. <N_Object_Renaming_Declaration>: If the renamed object has side-effects evaluate only its address. <N_Assignment_Statement>: Adjust call to Call_to_gnu. Use load-modify store sequence if required. <N_Function_Call>: Adjust call to Call_to_gnu. (extract_values): Adjust comment. * gcc-interface/utils2.c (build_atomic_load): Add SYNC parameter and use relaxed memory model if it is not set. (build_atomic_store): Likewise. (call_is_atomic_load): New predicate. (build_load_modify_store): New function. (build_binary_op) <MODIFY_EXPR>: Accept SAVE_EXPR on the LHS. (gnat_stabilize_reference) <CALL_EXPR>: Deal with atomic loads. From-SVN: r223652
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r--gcc/ada/gcc-interface/gigi.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 0419a53..35833ba 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -858,11 +858,18 @@ extern unsigned int known_alignment (tree exp);
of 2. */
extern bool value_factor_p (tree value, HOST_WIDE_INT factor);
-/* Build an atomic load for the underlying atomic object in SRC. */
-extern tree build_atomic_load (tree src);
+/* Build an atomic load for the underlying atomic object in SRC. SYNC is
+ true if the load requires synchronization. */
+extern tree build_atomic_load (tree src, bool sync);
-/* Build an atomic store from SRC to the underlying atomic object in DEST. */
-extern tree build_atomic_store (tree dest, tree src);
+/* Build an atomic store from SRC to the underlying atomic object in DEST.
+ SYNC is true if the store requires synchronization. */
+extern tree build_atomic_store (tree dest, tree src, bool sync);
+
+/* Build a load-modify-store sequence from SRC to DEST. GNAT_NODE is used for
+ the location of the sequence. Note that, even if the load and the store are
+ both atomic, the sequence itself is not atomic. */
+extern tree build_load_modify_store (tree dest, tree src, Node_Id gnat_node);
/* Make a binary operation of kind OP_CODE. RESULT_TYPE is the type
desired for the result. Usually the operation is to be performed
@@ -1053,9 +1060,6 @@ extern void enumerate_modes (void (*f) (const char *, int, int, int, int, int,
}
#endif
-/* Convenient shortcuts. */
-#define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
-
/* If EXP's type is a VECTOR_TYPE, return EXP converted to the associated
TYPE_REPRESENTATIVE_ARRAY. */
@@ -1070,6 +1074,8 @@ maybe_vector_array (tree exp)
return exp;
}
+/* Return the smallest power of 2 larger than X. */
+
static inline unsigned HOST_WIDE_INT
ceil_pow2 (unsigned HOST_WIDE_INT x)
{