gcc
* tree.h (struct tree_base): Add atomic_flag field.
(TYPE_ATOMIC): New accessor macro.
(enum cv_qualifier): Add TYPE_QUAL_ATOMIC.
(TYPE_QUALS, TYPE_QUALS_NO_ADDR_SPACE): Add TYPE_QUAL_ATOMIC.
(TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): New macro.
(enum tree_index): Add TI_ATOMIC{QHSDT}I_TYPE.
(atomic{QHSDT}I_type_node): Add new type nodes.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Atomics are volatile.
* function.c (assign_stack_temp_for_type): Atomics are volatile.
* hooks.c (hook_uint_mode_0): Return 0 unit hook.
* hooks.h (hook_uint_mode_0): Prototype.
* target.def (atomic_align_for_mode): define hook.
* print-tree.c (print_node): Print atomic qualifier.
* tree-pretty-print.c (dump_generic_node): Print atomic type attribute.
* tree.c (set_type_quals): Set TYPE_ATOMIC.
(find_atomic_base_type): New. Function to get atomic base from size.
(build_qualified_type): Tweak for atomic qualifier overrides.
(build_atomic_variant): New. Build atomic variant node.
(build_common_tree_nodes): Build atomic{QHSDT}I_type_node, allowing
for override with target hook.
* alias.c (objects_must_conflict_p): Treat atomics as volatile.
* calls.c (expand_call): Treat atomics as volatile.
c-family
* c-common.h (enum rid): Add RID_ATOMIC.
* c-common.c (struct c_common_resword c_common_r): Add "_Atomic".
(struct attribute_spec c_common_att): Add "atomic" attribute.
(handle_atomic_attribute): New. Add atomic qualifier to type.
(sync_resolve_params): Use MAIN_VARIANT as cast for the non-atomic
parameters.
(keyword_is_type_qualifier): Add RID_ATOMIC;
* c-format.c (check_format_types): Add atomic as a qualifer check.
* c-pretty-print.c (pp_c_cv_qualifiers): Handle atomic qualifier.
c
* c-tree.h (struct c_declspecs): Add atomic_p field.
* c-aux-info.c (gen_type): Handle atomic qualifier.
* c-decl.c (shadow_tag_warned): Add atomic_p to declspecs check.
(quals_from_declspecs): Add atomic_p to declspecs check.
(grokdeclarator): Check atomic and warn of duplicate or errors.
(build_null_declspecs): Handle atomic_p.
(declspecs_add_qual): Handle RID_ATOMIC.
* c-parser.c (c_token_starts_typename): Add RID_ATOMIC.
(c_token_is_qualifier, c_token_starts_declspecs): Add RID_ATOMIC.
(c_parser_declspecs, c_parser_attribute_any_word): Add RID_ATOMIC.
* c-typeck.c (build_indirect_ref): Treat atomic as volatile.
(build_array_ref, convert_for_assignment): Treat atomic as volatile.
objc
* objc-act.c (objc_push_parm): Treat atomic as volatile.
cp
* cp-tree.h (CP_TYPE_ATOMIC_P): New macro.
(enum cp_decl_spec): Add ds_atomic.
* class.c (build_simple_base_path): Treat atomic as volatile.
* cvt.c (diagnose_ref_binding): Handle atomic.
(convert_from_reference, convert_to_void): Treat atomic as volatile.
* decl.c (grokfndecl): Treat atomic as volatile.
(build_ptrmemfunc_type): Set TYPE_ATOMIC.
(grokdeclarator): handle atomic qualifier.
* mangle.c (dump_substitution_candidates): Add atomic to the qualifier
list.
* parser.c (cp_parser_type_specifier): Handle RID_ATOMIC.
(cp_parser_cv_qualifier_seq_opt): Handle RID_ATOMIC.
(set_and_check_decl_spec_loc): Add atomic to decl_spec_names[].
* pt.c (check_cv_quals_for_unify): Add TYPE_QUAL_ATOMIC to check.
* rtti.c (qualifier_flags): Set atomic qualifier flag.
* semantics.c (non_const_var_error): Check CP_TYPE_ATOMIC_P too.
* tree.c (cp_build_qualified_type_real): Add TYPE_QUAL_ATOMIC.
(cv_unqualified): Add TYPE_QUAL_ATOMIC to mask.
* typeck.c (build_class_member_access_expr): Treat atomic as volatile.
(cp_build_indirect_ref, cp_build_array_ref): Treat atomic as volatile.
(check_return_expr, cp_type_quals): Treat atomic as volatile.
(cv_qualified_p): Add TYPE_QUAL_ATOMIC to mask.
libstdc++-v3
* include/bits/atomic_base.h (struct __atomic_base): Add
__attribute__((atomic) to member data element.
(struct __atomic_base<_PTp*>): Add __attribute__((atomic)) to member
data element.
* include/std/atomic (struct atomic): Add __attribute__((atomic)) to
member data element.
fortran
* types.def (BT_ATOMIC_PTR, BT_CONST_ATOMIC_PTR): New
primitive data types for volatile atomic pointers.
(BT_FN_VOID_APTR): Renamed from BT_FN_VOID_VPTR.
(BT_FN_VOID_VPTR_INT, BT_FN_BOOL_VPTR_INT,
BT_FN_BOOL_SIZE_CONST_VPTR): Renamed to APTR variant.
(BT_FN_I{1,2,4,8,16}_CONST_APTR_INT): New.
(BT_FN_I{1,2,4,8,16}_APTR_I{1,2,4,8,16}_INT): New.
(BT_FN_VOID_APTR_I{1,2,4,8,16}_INT): New.
(BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT,
BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT): Renamed to APTR
variant.
gcc
* builtin-types.def (BT_ATOMIC_PTR, BT_CONST_ATOMIC_PTR): New
primitive data types for volatile atomic pointers.
(BT_FN_VOID_APTR): Renamed from BT_FN_VOID_VPTR.
(BT_FN_VOID_VPTR_INT, BT_FN_BOOL_VPTR_INT,
BT_FN_BOOL_SIZE_CONST_VPTR): Renamed to APTR variant.
(BT_FN_I{1,2,4,8,16}_CONST_APTR_INT): New.
(BT_FN_I{1,2,4,8,16}_APTR_I{1,2,4,8,16}_INT): New.
(BT_FN_VOID_APTR_I{1,2,4,8,16}_INT): New.
(BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT,
BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT): Renamed to APTR
variant.
* sync-builtins.def: Change all __atomic builtins to use the APTR
atomic pointer variant for the first parameter instead of VPTR..
doc
* generic.texi (CP_TYPE_ATOMIC_P): Document.
* tm.texi (TARGET_ATOMIC_TYPE_FOR_MODE): Define.
* doc/tm.texi.in (TARGET_ATOMIC_TYPE_FOR_MODE): Add.
testsuite
* gcc.dg/atomic-exchange-{1-5}.c: Change atomic var to use
__attribute__((atomic)).
* gcc.dg/atomic-op-{1-5}.c: Add --std=c11 and change atomic var to
use _Atomic keyword.
===================================================================
*************** struct GTY(()) tree_base {
unsigned packed_flag : 1;
unsigned user_align : 1;
unsigned nameless_flag : 1;
! unsigned spare0 : 4;
unsigned spare1 : 8;
unsigned packed_flag : 1;
unsigned user_align : 1;
unsigned nameless_flag : 1;
! unsigned atomic_flag : 1;
! unsigned spare0 : 3;
unsigned spare1 : 8;
*************** extern enum machine_mode vector_type_mod
/* Nonzero in a type considered volatile as a whole. */
#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
+ /* Nonzero in a type considered atomic as a whole. */
+ #define TYPE_ATOMIC(NODE) (TYPE_CHECK (NODE)->base.u.bits.atomic_flag)
+
/* Means this type is const-qualified. */
#define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
*************** enum cv_qualifier
TYPE_UNQUALIFIED = 0x0,
TYPE_QUAL_CONST = 0x1,
TYPE_QUAL_VOLATILE = 0x2,
! TYPE_QUAL_RESTRICT = 0x4
};
/* Encode/decode the named memory support as part of the qualifier. If more
TYPE_UNQUALIFIED = 0x0,
TYPE_QUAL_CONST = 0x1,
TYPE_QUAL_VOLATILE = 0x2,
! TYPE_QUAL_RESTRICT = 0x4,
! TYPE_QUAL_ATOMIC = 0x8
};
/* Encode/decode the named memory support as part of the qualifier. If more
*************** enum cv_qualifier
#define TYPE_QUALS(NODE) \
((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
| (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_ATOMIC (NODE) * TYPE_QUAL_ATOMIC) \
| (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
| (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE)))))
*************** enum cv_qualifier
#define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
| (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_ATOMIC (NODE) * TYPE_QUAL_ATOMIC) \
+ | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
+ /* The same as TYPE_QUALS without the address space and atomic
+ qualifications. */
+ #define TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC(NODE) \
+ ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
+ | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
| (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
+
/* These flags are available for each language front end to use internally. */
#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)
#define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_1)
*************** enum tree_index
TI_UINTDI_TYPE,
TI_UINTTI_TYPE,
+ TI_ATOMICQI_TYPE,
+ TI_ATOMICHI_TYPE,
+ TI_ATOMICSI_TYPE,
+ TI_ATOMICDI_TYPE,
+ TI_ATOMICTI_TYPE,
+
TI_UINT16_TYPE,
TI_UINT32_TYPE,
TI_UINT64_TYPE,
*************** extern GTY(()) tree global_trees[TI_MAX]
#define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
#define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
+ #define atomicQI_type_node global_trees[TI_ATOMICQI_TYPE]
+ #define atomicHI_type_node global_trees[TI_ATOMICHI_TYPE]
+ #define atomicSI_type_node global_trees[TI_ATOMICSI_TYPE]
+ #define atomicDI_type_node global_trees[TI_ATOMICDI_TYPE]
+ #define atomicTI_type_node global_trees[TI_ATOMICTI_TYPE]
+
#define uint16_type_node global_trees[TI_UINT16_TYPE]
#define uint32_type_node global_trees[TI_UINT32_TYPE]
#define uint64_type_node global_trees[TI_UINT64_TYPE]
*************** extern tree build_aligned_type (tree, un
extern tree build_distinct_type_copy (tree);
extern tree build_variant_type_copy (tree);
+ /* Find an atomic base type. */
+ extern tree find_atomic_base_type (tree, tree *);
+
/* Finish up a builtin RECORD_TYPE. Give it a name and provide its
fields. Optionally specify an alignment, and then lay it out. */
===================================================================
*************** set_mem_attributes_minus_bitpos (rtx ref
front-end routine) and use it. */
attrs.alias = get_alias_set (t);
! MEM_VOLATILE_P (ref) |= TYPE_VOLATILE (type);
MEM_POINTER (ref) = POINTER_TYPE_P (type);
/* Default values from pre-existing memory attributes if present. */
front-end routine) and use it. */
attrs.alias = get_alias_set (t);
! MEM_VOLATILE_P (ref) |= (TYPE_VOLATILE (type) || TYPE_ATOMIC (type));
MEM_POINTER (ref) = POINTER_TYPE_P (type);
/* Default values from pre-existing memory attributes if present. */
===================================================================
*************** assign_stack_temp_for_type (enum machine
/* If a type is specified, set the relevant flags. */
if (type != 0)
! MEM_VOLATILE_P (slot) = TYPE_VOLATILE (type);
MEM_NOTRAP_P (slot) = 1;
return slot;
/* If a type is specified, set the relevant flags. */
if (type != 0)
! MEM_VOLATILE_P (slot) = (TYPE_VOLATILE (type) || TYPE_ATOMIC (type));
MEM_NOTRAP_P (slot) = 1;
return slot;
===================================================================
*************** hook_rtx_tree_int_null (tree a ATTRIBUTE
return NULL;
}
+ /* Generic hook that takes a machine mode and returns an unsigned int 0. */
+ unsigned int
+ hook_uint_mode_0 (enum machine_mode m ATTRIBUTE_UNUSED)
+ {
+ return 0;
+ }
+
/* Generic hook that takes three trees and returns the last one as is. */
tree
hook_tree_tree_tree_tree_3rd_identity (tree a ATTRIBUTE_UNUSED,
===================================================================
*************** extern tree hook_tree_tree_tree_tree_3rd
extern tree hook_tree_tree_int_treep_bool_null (tree, int, tree *, bool);
extern unsigned hook_uint_void_0 (void);
+ extern unsigned int hook_uint_mode_0 (enum machine_mode);
extern bool default_can_output_mi_thunk_no_vcall (const_tree, HOST_WIDE_INT,
HOST_WIDE_INT, const_tree);
===================================================================
*************** DEFHOOKPOD
@code{atomic_test_and_set} is not exactly 1, i.e. the\
@code{bool} @code{true}.",
unsigned char, 1)
!
/* Leave the boolean fields at the end. */
/* True if we can create zeroed data by switching to a BSS section
@code{atomic_test_and_set} is not exactly 1, i.e. the\
@code{bool} @code{true}.",
unsigned char, 1)
!
! /* Return a tree type representing the atomic type which maps to machine MODE.
! This allows both alignment and size to be overridden as needed. */
! DEFHOOK
! (atomic_align_for_mode,
! "If defined, this function returns an appropriate alignment in bits for an\
! atomic object of machine_mode @var{mode}. If 0 is returned then the\
! default alignment for the specified mode is used. ",
! unsigned int, (enum machine_mode mode),
! hook_uint_mode_0)
!
!
/* Leave the boolean fields at the end. */
/* True if we can create zeroed data by switching to a BSS section
===================================================================
*************** print_node (FILE *file, const char *pref
if (TYPE_P (node) ? TYPE_READONLY (node) : TREE_READONLY (node))
fputs (" readonly", file);
+ if (TYPE_P (node) ? TYPE_ATOMIC (node) : TYPE_ATOMIC (node))
+ fputs (" atomic", file);
if (!TYPE_P (node) && TREE_CONSTANT (node))
fputs (" constant", file);
else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
===================================================================
*************** dump_generic_node (pretty_printer *buffe
unsigned int quals = TYPE_QUALS (node);
enum tree_code_class tclass;
+ if (quals & TYPE_QUAL_ATOMIC)
+ pp_string (buffer, "atomic ");
if (quals & TYPE_QUAL_CONST)
pp_string (buffer, "const ");
else if (quals & TYPE_QUAL_VOLATILE)
*************** dump_generic_node (pretty_printer *buffe
{
unsigned int quals = TYPE_QUALS (node);
+ if (quals & TYPE_QUAL_ATOMIC)
+ pp_string (buffer, "atomic ");
if (quals & TYPE_QUAL_CONST)
pp_string (buffer, "const ");
if (quals & TYPE_QUAL_VOLATILE)
===================================================================
*************** set_type_quals (tree type, int type_qual
TYPE_READONLY (type) = (type_quals & TYPE_QUAL_CONST) != 0;
TYPE_VOLATILE (type) = (type_quals & TYPE_QUAL_VOLATILE) != 0;
TYPE_RESTRICT (type) = (type_quals & TYPE_QUAL_RESTRICT) != 0;
+ TYPE_ATOMIC (type) = (type_quals & TYPE_QUAL_ATOMIC) != 0;
TYPE_ADDR_SPACE (type) = DECODE_QUAL_ADDR_SPACE (type_quals);
}
*************** check_aligned_type (const_tree cand, con
TYPE_ATTRIBUTES (base)));
}
+ /* This function checks to see if TYPE matches the size one of the built in
+ atomic types, and returns that atomic type.
+ The non-atomic base type is also returned if NONATOMIC_TYPE is non-NULL. */
+
+ tree
+ find_atomic_base_type (tree type, tree *nonatomic_type)
+ {
+ tree base_type, base_atomic_type;
+
+ if (!TYPE_P (type) || type == void_type_node)
+ return NULL_TREE;
+
+ HOST_WIDE_INT type_size = tree_low_cst (TYPE_SIZE (type), 1);
+ switch (type_size)
+ {
+ case 8:
+ base_atomic_type = atomicQI_type_node;
+ base_type = unsigned_intQI_type_node;
+ break;
+
+ case 16:
+ base_atomic_type = atomicHI_type_node;
+ base_type = unsigned_intHI_type_node;
+ break;
+
+ case 32:
+ base_atomic_type = atomicSI_type_node;
+ base_type = unsigned_intSI_type_node;
+ break;
+
+ case 64:
+ base_atomic_type = atomicDI_type_node;
+ base_type = unsigned_intDI_type_node;
+ break;
+
+ case 128:
+ base_atomic_type = atomicTI_type_node;
+ base_type = unsigned_intTI_type_node;
+ break;
+
+ default:
+ base_atomic_type = NULL_TREE;
+ base_type = NULL_TREE;
+ }
+
+ if (nonatomic_type)
+ *nonatomic_type = base_type;
+
+ return base_atomic_type;
+ }
+
/* Return a version of the TYPE, qualified as indicated by the
TYPE_QUALS, if one exists. If no qualified version exists yet,
return NULL_TREE. */
*************** build_qualified_type (tree type, int typ
t = build_variant_type_copy (type);
set_type_quals (t, type_quals);
+ if (((type_quals & TYPE_QUAL_ATOMIC) == TYPE_QUAL_ATOMIC)
+ && INTEGRAL_TYPE_P (type))
+ {
+ tree atomic_base_type = find_atomic_base_type (type, NULL);
+ if (atomic_base_type)
+ TYPE_ALIGN (t) = TYPE_ALIGN (atomic_base_type);
+ }
+
if (TYPE_STRUCTURAL_EQUALITY_P (type))
/* Propagate structural equality. */
SET_TYPE_STRUCTURAL_EQUALITY (t);
*************** make_or_reuse_accum_type (unsigned size,
return make_accum_type (size, unsignedp, satp);
}
+
+ /* Create an atomic variant node for TYPE. This routine is called during
+ initialization of data types to create the 5 basic atomic types. The generic
+ build_variant_type function requires these to already be set up in order to
+ function properly, so cannot be called from there.
+ if ALIGN is non-zero, then ensure alignment is overridden to this value. */
+
+ static tree
+ build_atomic_variant (tree type, unsigned int align)
+ {
+ tree t;
+
+ /* Make sure its not already registered. */
+ if ((t = get_qualified_type (type, TYPE_QUAL_ATOMIC)))
+ return t;
+
+ t = build_variant_type_copy (type);
+ set_type_quals (t, TYPE_QUAL_ATOMIC);
+
+ if (align)
+ TYPE_ALIGN (t) = align;
+
+ return t;
+ }
+
/* Create nodes for all integer types (and error_mark_node) using the sizes
of C datatypes. SIGNED_CHAR specifies whether char is signed,
SHORT_DOUBLE specifies whether double should be of the same precision
*************** build_common_tree_nodes (bool signed_cha
unsigned_intDI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (DImode), 1);
unsigned_intTI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (TImode), 1);
+ /* Dont call build_qualified type for atomics. That routine does special
+ processing for atomics, and until they are initialized its better not
+ to make that call.
+
+ Check to see if there is a target override for atomic types. */
+
+ #define SET_ATOMIC_TYPE_NODE(TYPE, MODE, DEFAULT) \
+ (TYPE) = build_atomic_variant (DEFAULT, targetm.atomic_align_for_mode (MODE));
+
+ SET_ATOMIC_TYPE_NODE (atomicQI_type_node, QImode, unsigned_intQI_type_node);
+ SET_ATOMIC_TYPE_NODE (atomicHI_type_node, HImode, unsigned_intHI_type_node);
+ SET_ATOMIC_TYPE_NODE (atomicSI_type_node, SImode, unsigned_intSI_type_node);
+ SET_ATOMIC_TYPE_NODE (atomicDI_type_node, DImode, unsigned_intDI_type_node);
+ SET_ATOMIC_TYPE_NODE (atomicTI_type_node, TImode, unsigned_intTI_type_node);
+
access_public_node = get_identifier ("public");
access_protected_node = get_identifier ("protected");
access_private_node = get_identifier ("private");
===================================================================
*************** objects_must_conflict_p (tree t1, tree t
/* If they are the same type, they must conflict. */
if (t1 == t2
/* Likewise if both are volatile. */
! || (t1 != 0 && TYPE_VOLATILE (t1) && t2 != 0 && TYPE_VOLATILE (t2)))
return 1;
set1 = t1 ? get_alias_set (t1) : 0;
/* If they are the same type, they must conflict. */
if (t1 == t2
/* Likewise if both are volatile. */
! || (t1 != 0 && (TYPE_VOLATILE (t1) || TYPE_ATOMIC (t1))
! && t2 != 0 && (TYPE_VOLATILE (t2) || TYPE_ATOMIC (t2))))
return 1;
set1 = t1 ? get_alias_set (t1) : 0;
===================================================================
*************** expand_call (tree exp, rtx target, int i
optimized. */
|| (flags & (ECF_RETURNS_TWICE | ECF_NORETURN))
|| TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr)))
+ || TYPE_ATOMIC (TREE_TYPE (TREE_TYPE (addr)))
/* If the called function is nested in the current one, it might access
some of the caller's arguments, but could clobber them beforehand if
the argument areas are shared. */
===================================================================
*************** enum rid
RID_UNSIGNED, RID_LONG, RID_CONST, RID_EXTERN,
RID_REGISTER, RID_TYPEDEF, RID_SHORT, RID_INLINE,
RID_VOLATILE, RID_SIGNED, RID_AUTO, RID_RESTRICT,
! RID_NORETURN,
/* C extensions */
RID_COMPLEX, RID_THREAD, RID_SAT,
RID_UNSIGNED, RID_LONG, RID_CONST, RID_EXTERN,
RID_REGISTER, RID_TYPEDEF, RID_SHORT, RID_INLINE,
RID_VOLATILE, RID_SIGNED, RID_AUTO, RID_RESTRICT,
! RID_NORETURN, RID_ATOMIC,
/* C extensions */
RID_COMPLEX, RID_THREAD, RID_SAT,
===================================================================
*************** static tree handle_unused_attribute (tre
static tree handle_externally_visible_attribute (tree *, tree, tree, int,
bool *);
static tree handle_const_attribute (tree *, tree, tree, int, bool *);
+ static tree handle_atomic_attribute (tree *, tree, tree, int, bool *);
static tree handle_transparent_union_attribute (tree *, tree, tree,
int, bool *);
static tree handle_constructor_attribute (tree *, tree, tree, int, bool *);
*************** const struct c_common_resword c_common_r
{
{ "_Alignas", RID_ALIGNAS, D_CONLY },
{ "_Alignof", RID_ALIGNOF, D_CONLY },
+ { "_Atomic", RID_ATOMIC, D_CONLY },
{ "_Bool", RID_BOOL, D_CONLY },
{ "_Complex", RID_COMPLEX, 0 },
{ "_Imaginary", RID_IMAGINARY, D_CONLY },
*************** const struct attribute_spec c_common_att
/* The same comments as for noreturn attributes apply to const ones. */
{ "const", 0, 0, true, false, false,
handle_const_attribute, false },
+ { "atomic", 0, 0, false, true, false,
+ handle_atomic_attribute, false},
{ "transparent_union", 0, 0, false, false, false,
handle_transparent_union_attribute, false },
{ "constructor", 0, 1, true, false, false,
*************** handle_const_attribute (tree *node, tree
return NULL_TREE;
}
+
+ /* Handle an "atomic" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+ static tree
+ handle_atomic_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+ {
+ bool ignored = true;
+ if (TYPE_P (*node) && TREE_CODE (*node) != ARRAY_TYPE)
+ {
+ tree type = *node;
+
+ if (!TYPE_ATOMIC (type))
+ {
+ *node = build_qualified_type (type, TYPE_QUAL_ATOMIC);
+ ignored = false;
+ }
+ }
+
+ if (ignored)
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+ return NULL_TREE;
+ }
+
/* Handle a "transparent_union" attribute; arguments as in
struct attribute_spec.handler. */
*************** sync_resolve_params (location_t loc, tre
unsigned int parmnum;
function_args_iter_init (&iter, TREE_TYPE (function));
! /* We've declared the implementation functions to use "volatile void *"
as the pointer parameter, so we shouldn't get any complaints from the
call to check_function_arguments what ever type the user used. */
function_args_iter_next (&iter);
ptype = TREE_TYPE (TREE_TYPE ((*params)[0]));
/* For the rest of the values, we need to cast these to FTYPE, so that we
don't get warnings for passing pointer types, etc. */
unsigned int parmnum;
function_args_iter_init (&iter, TREE_TYPE (function));
! /* We've declared the implementation functions to use "atomic volatile void *"
as the pointer parameter, so we shouldn't get any complaints from the
call to check_function_arguments what ever type the user used. */
function_args_iter_next (&iter);
ptype = TREE_TYPE (TREE_TYPE ((*params)[0]));
+ ptype = TYPE_MAIN_VARIANT (ptype);
/* For the rest of the values, we need to cast these to FTYPE, so that we
don't get warnings for passing pointer types, etc. */
*************** keyword_is_type_qualifier (enum rid keyw
case RID_CONST:
case RID_VOLATILE:
case RID_RESTRICT:
+ case RID_ATOMIC:
return true;
default:
return false;
===================================================================
*************** check_format_types (format_wanted_type *
&& pedantic
&& (TYPE_READONLY (cur_type)
|| TYPE_VOLATILE (cur_type)
+ || TYPE_ATOMIC (cur_type)
|| TYPE_RESTRICT (cur_type)))
warning (OPT_Wformat_, "extra type qualifiers in format "
"argument (argument %d)",
===================================================================
*************** pp_c_cv_qualifiers (c_pretty_printer *pp
if (p != NULL && (*p == '*' || *p == '&'))
pp_c_whitespace (pp);
+ if (qualifiers & TYPE_QUAL_ATOMIC)
+ {
+ pp_c_ws_string (pp, func_type ? "__attribute__((atomic))" : "atomic");
+ previous = true;
+ }
+
if (qualifiers & TYPE_QUAL_CONST)
{
+ if (previous)
+ pp_c_whitespace (pp);
pp_c_ws_string (pp, func_type ? "__attribute__((const))" : "const");
previous = true;
}
===================================================================
*************** struct c_declspecs {
BOOL_BITFIELD volatile_p : 1;
/* Whether "restrict" was specified. */
BOOL_BITFIELD restrict_p : 1;
+ /* Whether "_Atomic" was specified. */
+ BOOL_BITFIELD atomic_p : 1;
/* Whether "_Sat" was specified. */
BOOL_BITFIELD saturating_p : 1;
/* Whether any alignment specifier (even with zero alignment) was
===================================================================
*************** gen_type (const char *ret_val, tree t, f
switch (TREE_CODE (t))
{
case POINTER_TYPE:
+ if (TYPE_ATOMIC (t))
+ ret_val = concat ("atomic ", ret_val, NULL);
if (TYPE_READONLY (t))
ret_val = concat ("const ", ret_val, NULL);
if (TYPE_VOLATILE (t))
*************** gen_type (const char *ret_val, tree t, f
gcc_unreachable ();
}
}
+ if (TYPE_ATOMIC (t))
+ ret_val = concat ("atomic ", ret_val, NULL);
if (TYPE_READONLY (t))
ret_val = concat ("const ", ret_val, NULL);
if (TYPE_VOLATILE (t))
===================================================================
*************** shadow_tag_warned (const struct c_declsp
&& declspecs->typespec_kind != ctsk_tagfirstref
&& (declspecs->const_p
|| declspecs->volatile_p
+ || declspecs->atomic_p
|| declspecs->restrict_p
|| declspecs->address_space))
{
*************** shadow_tag_warned (const struct c_declsp
if (!warned && !in_system_header && (declspecs->const_p
|| declspecs->volatile_p
+ || declspecs->atomic_p
|| declspecs->restrict_p
|| declspecs->address_space))
{
*************** quals_from_declspecs (const struct c_dec
int quals = ((specs->const_p ? TYPE_QUAL_CONST : 0)
| (specs->volatile_p ? TYPE_QUAL_VOLATILE : 0)
| (specs->restrict_p ? TYPE_QUAL_RESTRICT : 0)
+ | (specs->atomic_p ? TYPE_QUAL_ATOMIC : 0)
| (ENCODE_QUAL_ADDR_SPACE (specs->address_space)));
gcc_assert (!specs->type
&& !specs->decl_attr
*************** grokdeclarator (const struct c_declarato
int constp;
int restrictp;
int volatilep;
+ int atomicp;
int type_quals = TYPE_UNQUALIFIED;
tree name = NULL_TREE;
bool funcdef_flag = false;
*************** grokdeclarator (const struct c_declarato
constp = declspecs->const_p + TYPE_READONLY (element_type);
restrictp = declspecs->restrict_p + TYPE_RESTRICT (element_type);
volatilep = declspecs->volatile_p + TYPE_VOLATILE (element_type);
+ atomicp = declspecs->atomic_p + TYPE_ATOMIC (element_type);
as1 = declspecs->address_space;
as2 = TYPE_ADDR_SPACE (element_type);
address_space = ADDR_SPACE_GENERIC_P (as1)? as2 : as1;
*************** grokdeclarator (const struct c_declarato
pedwarn (loc, OPT_Wpedantic, "duplicate %<restrict%>");
if (volatilep > 1)
pedwarn (loc, OPT_Wpedantic, "duplicate %<volatile%>");
+ if (atomicp > 1)
+ pedwarn (loc, OPT_Wpedantic, "duplicate %<_Atomic%>");
+
}
if (!ADDR_SPACE_GENERIC_P (as1) && !ADDR_SPACE_GENERIC_P (as2) && as1 != as2)
*************** grokdeclarator (const struct c_declarato
type_quals = ((constp ? TYPE_QUAL_CONST : 0)
| (restrictp ? TYPE_QUAL_RESTRICT : 0)
| (volatilep ? TYPE_QUAL_VOLATILE : 0)
+ | (atomicp ? TYPE_QUAL_ATOMIC : 0)
| ENCODE_QUAL_ADDR_SPACE (address_space));
/* Warn about storage classes that are invalid for certain
*************** grokdeclarator (const struct c_declarato
array_ptr_attrs = NULL_TREE;
array_parm_static = 0;
}
+
+ if (atomicp)
+ {
+ error_at (loc, "_Atomic type qualifier in array declarator");
+ type = error_mark_node;
+ }
break;
}
case cdk_function:
*************** grokdeclarator (const struct c_declarato
FOR_EACH_VEC_SAFE_ELT_REVERSE (arg_info->tags, ix, tag)
TYPE_CONTEXT (tag->type) = type;
}
+ if (atomicp)
+ {
+ error_at (loc, "_Atomic type qualifier in function declarator");
+ type = error_mark_node;
+ }
break;
}
case cdk_pointer:
*************** build_null_declspecs (void)
ret->thread_p = false;
ret->const_p = false;
ret->volatile_p = false;
+ ret->atomic_p = false;
ret->restrict_p = false;
ret->saturating_p = false;
ret->alignas_p = false;
*************** declspecs_add_qual (source_location loc,
specs->restrict_p = true;
specs->locations[cdw_restrict] = loc;
break;
+ case RID_ATOMIC:
+ dupe = specs->atomic_p;
+ specs->atomic_p = true;
+ break;
default:
gcc_unreachable ();
}
===================================================================
*************** c_token_starts_typename (c_token *token)
case RID_UNION:
case RID_TYPEOF:
case RID_CONST:
+ case RID_ATOMIC:
case RID_VOLATILE:
case RID_RESTRICT:
case RID_ATTRIBUTE:
*************** c_token_is_qualifier (c_token *token)
case RID_VOLATILE:
case RID_RESTRICT:
case RID_ATTRIBUTE:
+ case RID_ATOMIC:
return true;
default:
return false;
*************** c_token_starts_declspecs (c_token *token
case RID_ACCUM:
case RID_SAT:
case RID_ALIGNAS:
+ case RID_ATOMIC:
return true;
default:
return false;
*************** c_parser_static_assert_declaration_no_se
restrict
volatile
address-space-qualifier
+ atomic
(restrict is new in C99.)
+ (atomic is new in C11.)
GNU extensions:
*************** c_parser_declspecs (c_parser *parser, st
t = c_parser_typeof_specifier (parser);
declspecs_add_type (loc, specs, t);
break;
+ case RID_ATOMIC:
+ if (!flag_isoc11)
+ pedwarn (loc, 0, "_Atomic qualifier provided in ISO C11");
+ /* Fallthru. */
case RID_CONST:
case RID_VOLATILE:
case RID_RESTRICT:
*************** c_parser_attribute_any_word (c_parser *p
case RID_SAT:
case RID_TRANSACTION_ATOMIC:
case RID_TRANSACTION_CANCEL:
+ case RID_ATOMIC:
ok = true;
break;
default:
===================================================================
*************** build_indirect_ref (location_t loc, tree
/* A de-reference of a pointer to const is not a const. It is valid
to change it via some other pointer. */
TREE_READONLY (ref) = TYPE_READONLY (t);
! TREE_SIDE_EFFECTS (ref)
! = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer);
! TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
protected_set_expr_location (ref, loc);
return ref;
}
/* A de-reference of a pointer to const is not a const. It is valid
to change it via some other pointer. */
TREE_READONLY (ref) = TYPE_READONLY (t);
! TREE_SIDE_EFFECTS (ref) = (TYPE_VOLATILE (t) || TYPE_ATOMIC (t)
! || TREE_SIDE_EFFECTS (pointer));
! TREE_THIS_VOLATILE (ref) = (TYPE_VOLATILE (t) || TYPE_ATOMIC (t));
protected_set_expr_location (ref, loc);
return ref;
}
*************** build_array_ref (location_t loc, tree ar
| TREE_READONLY (array));
TREE_SIDE_EFFECTS (rval)
|= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
+ | TYPE_ATOMIC (TREE_TYPE (TREE_TYPE (array)))
| TREE_SIDE_EFFECTS (array));
TREE_THIS_VOLATILE (rval)
|= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
+ | TYPE_ATOMIC (TREE_TYPE (TREE_TYPE (array)))
/* This was added by rms on 16 Nov 91.
It fixes vol struct foo *a; a->elts[1]
in an inline function.
*************** convert_for_assignment (location_t locat
else if (TREE_CODE (ttr) != FUNCTION_TYPE
&& TREE_CODE (ttl) != FUNCTION_TYPE)
{
! if (TYPE_QUALS_NO_ADDR_SPACE (ttr)
! & ~TYPE_QUALS_NO_ADDR_SPACE (ttl))
{
WARN_FOR_QUALIFIERS (location, 0,
G_("passing argument %d of %qE discards "
else if (TREE_CODE (ttr) != FUNCTION_TYPE
&& TREE_CODE (ttl) != FUNCTION_TYPE)
{
! /* Assignments between atomic and non-atomic objects are OK since
! the atomic access is always through an interface call. */
! if (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
! & ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl))
{
WARN_FOR_QUALIFIERS (location, 0,
G_("passing argument %d of %qE discards "
===================================================================
*************** objc_push_parm (tree parm)
c_apply_type_quals_to_decl
((TYPE_READONLY (TREE_TYPE (parm)) ? TYPE_QUAL_CONST : 0)
| (TYPE_RESTRICT (TREE_TYPE (parm)) ? TYPE_QUAL_RESTRICT : 0)
+ | (TYPE_ATOMIC (TREE_TYPE (parm)) ? TYPE_QUAL_ATOMIC : 0)
| (TYPE_VOLATILE (TREE_TYPE (parm)) ? TYPE_QUAL_VOLATILE : 0), parm);
objc_parmlist = chainon (objc_parmlist, parm);
===================================================================
*************** enum languages { lang_c, lang_cplusplus,
#define CP_TYPE_VOLATILE_P(NODE) \
((cp_type_quals (NODE) & TYPE_QUAL_VOLATILE) != 0)
+ /* Nonzero if this type is atomic-qualified. */
+ #define CP_TYPE_ATOMIC_P(NODE) \
+ ((cp_type_quals (NODE) & TYPE_QUAL_ATOMIC) != 0)
+
/* Nonzero if this type is restrict-qualified. */
#define CP_TYPE_RESTRICT_P(NODE) \
((cp_type_quals (NODE) & TYPE_QUAL_RESTRICT) != 0)
*************** typedef enum cp_decl_spec {
ds_const,
ds_volatile,
ds_restrict,
+ ds_atomic,
ds_inline,
ds_virtual,
ds_explicit,
===================================================================
*************** build_simple_base_path (tree expr, tree
to mark the expression itself. */
if (type_quals & TYPE_QUAL_CONST)
TREE_READONLY (expr) = 1;
! if (type_quals & TYPE_QUAL_VOLATILE)
TREE_THIS_VOLATILE (expr) = 1;
return expr;
to mark the expression itself. */
if (type_quals & TYPE_QUAL_CONST)
TREE_READONLY (expr) = 1;
! if (type_quals & (TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC))
TREE_THIS_VOLATILE (expr) = 1;
return expr;
===================================================================
*************** diagnose_ref_binding (location_t loc, tr
else if (CP_TYPE_VOLATILE_P (ttl))
msg = G_("conversion to volatile reference type %q#T "
"from rvalue of type %qT");
+ else if (CP_TYPE_ATOMIC_P (ttl) && decl)
+ msg = G_("initialization of atomic reference type %q#T from "
+ "rvalue of type %qT");
+ else if (CP_TYPE_ATOMIC_P (ttl))
+ msg = G_("conversion to atomic reference type %q#T "
+ "from rvalue of type %qT");
else if (decl)
msg = G_("initialization of non-const reference type %q#T from "
"rvalue of type %qT");
*************** convert_from_reference (tree val)
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
TREE_READONLY (ref) = CP_TYPE_CONST_P (t);
! TREE_THIS_VOLATILE (ref) = CP_TYPE_VOLATILE_P (t);
TREE_SIDE_EFFECTS (ref)
= (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (val));
val = ref;
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
TREE_READONLY (ref) = CP_TYPE_CONST_P (t);
! TREE_THIS_VOLATILE (ref) = (CP_TYPE_VOLATILE_P (t)
! || CP_TYPE_ATOMIC_P (t));
TREE_SIDE_EFFECTS (ref)
= (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (val));
val = ref;
*************** convert_to_void (tree expr, impl_conv_vo
tree type = TREE_TYPE (expr);
int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0)))
== REFERENCE_TYPE;
! int is_volatile = TYPE_VOLATILE (type);
int is_complete = COMPLETE_TYPE_P (complete_type (type));
/* Can't load the value if we don't know the type. */
tree type = TREE_TYPE (expr);
int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0)))
== REFERENCE_TYPE;
! int is_volatile = (TYPE_VOLATILE (type) || TYPE_ATOMIC (type));
int is_complete = COMPLETE_TYPE_P (complete_type (type));
/* Can't load the value if we don't know the type. */
*************** convert_to_void (tree expr, impl_conv_vo
tree type = TREE_TYPE (expr);
int is_complete = COMPLETE_TYPE_P (complete_type (type));
! if (TYPE_VOLATILE (type) && !is_complete && (complain & tf_warning))
switch (implicit)
{
case ICV_CAST:
tree type = TREE_TYPE (expr);
int is_complete = COMPLETE_TYPE_P (complete_type (type));
! if ((TYPE_VOLATILE (type) || TYPE_ATOMIC (type))
! && !is_complete && (complain & tf_warning))
switch (implicit)
{
case ICV_CAST:
===================================================================
*************** grokfndecl (tree ctype,
for (t = parms; t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = decl;
/* Propagate volatile out from type to decl. */
! if (TYPE_VOLATILE (type))
TREE_THIS_VOLATILE (decl) = 1;
/* Setup decl according to sfk. */
for (t = parms; t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = decl;
/* Propagate volatile out from type to decl. */
! if (TYPE_VOLATILE (type) || TYPE_ATOMIC (type))
TREE_THIS_VOLATILE (decl) = 1;
/* Setup decl according to sfk. */
*************** build_ptrmemfunc_type (tree type)
TYPE_READONLY (t) = (type_quals & TYPE_QUAL_CONST) != 0;
TYPE_VOLATILE (t) = (type_quals & TYPE_QUAL_VOLATILE) != 0;
TYPE_RESTRICT (t) = (type_quals & TYPE_QUAL_RESTRICT) != 0;
+ TYPE_ATOMIC (t) = (type_quals & TYPE_QUAL_ATOMIC) != 0;
TYPE_MAIN_VARIANT (t) = unqualified_variant;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant);
TYPE_NEXT_VARIANT (unqualified_variant) = t;
*************** grokdeclarator (const cp_declarator *dec
type_quals |= TYPE_QUAL_VOLATILE;
if (decl_spec_seq_has_spec_p (declspecs, ds_restrict))
type_quals |= TYPE_QUAL_RESTRICT;
+ if (decl_spec_seq_has_spec_p (declspecs, ds_atomic))
+ type_quals |= TYPE_QUAL_ATOMIC;
if (sfk == sfk_conversion && type_quals != TYPE_UNQUALIFIED)
error ("qualifiers are not allowed on declaration of %<operator %T%>",
ctor_return_type);
===================================================================
*************** dump_substitution_candidates (void)
if (TYPE_P (el) &&
(CP_TYPE_RESTRICT_P (el)
|| CP_TYPE_VOLATILE_P (el)
+ || CP_TYPE_ATOMIC_P (el)
|| CP_TYPE_CONST_P (el)))
fprintf (stderr, "CV-");
fprintf (stderr, "%s (%s at %p)\n",
===================================================================
*************** cp_parser_type_specifier (cp_parser* par
*is_cv_qualifier = true;
break;
+ case RID_ATOMIC:
+ ds = ds_atomic;
+ if (is_cv_qualifier)
+ *is_cv_qualifier = true;
+ if (!flag_isoc11)
+ pedwarn (token->location, 0, "_Atomic qualifier provided in ISO C11");
+ break;
+
case RID_RESTRICT:
ds = ds_restrict;
if (is_cv_qualifier)
*************** cp_parser_cv_qualifier_seq_opt (cp_parse
cv_qualifier = TYPE_QUAL_RESTRICT;
break;
+ case RID_ATOMIC:
+ cv_qualifier = TYPE_QUAL_ATOMIC;
+ break;
+
default:
cv_qualifier = TYPE_UNQUALIFIED;
break;
*************** set_and_check_decl_spec_loc (cp_decl_spe
"const",
"volatile",
"restrict",
+ "atomic"
"inline",
"virtual",
"explicit",
===================================================================
*************** check_cv_quals_for_unify (int strict, tr
if ((TREE_CODE (arg) == REFERENCE_TYPE
|| TREE_CODE (arg) == FUNCTION_TYPE
|| TREE_CODE (arg) == METHOD_TYPE)
! && (parm_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)))
return 0;
if ((!POINTER_TYPE_P (arg) && TREE_CODE (arg) != TEMPLATE_TYPE_PARM)
if ((TREE_CODE (arg) == REFERENCE_TYPE
|| TREE_CODE (arg) == FUNCTION_TYPE
|| TREE_CODE (arg) == METHOD_TYPE)
! && (parm_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE
! | TYPE_QUAL_ATOMIC)))
return 0;
if ((!POINTER_TYPE_P (arg) && TREE_CODE (arg) != TEMPLATE_TYPE_PARM)
===================================================================
*************** qualifier_flags (tree type)
flags |= 2;
if (quals & TYPE_QUAL_RESTRICT)
flags |= 4;
+ if (quals & TYPE_QUAL_ATOMIC)
+ flags |= 8;
return flags;
}
===================================================================
*************** non_const_var_error (tree r)
else if (CP_TYPE_VOLATILE_P (type))
inform (DECL_SOURCE_LOCATION (r),
"%q#D is volatile", r);
+ else if (CP_TYPE_ATOMIC_P (type))
+ inform (DECL_SOURCE_LOCATION (r),
+ "%q#D is atomic", r);
else if (!DECL_INITIAL (r)
|| !TREE_CONSTANT (DECL_INITIAL (r)))
inform (DECL_SOURCE_LOCATION (r),
===================================================================
*************** cp_build_qualified_type_real (tree type,
/* A reference or method type shall not be cv-qualified.
[dcl.ref], [dcl.fct]. This used to be an error, but as of DR 295
(in CD1) we always ignore extra cv-quals on functions. */
! if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
&& (TREE_CODE (type) == REFERENCE_TYPE
|| TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE))
{
if (TREE_CODE (type) == REFERENCE_TYPE)
! bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
! type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
}
/* But preserve any function-cv-quals on a FUNCTION_TYPE. */
/* A reference or method type shall not be cv-qualified.
[dcl.ref], [dcl.fct]. This used to be an error, but as of DR 295
(in CD1) we always ignore extra cv-quals on functions. */
! if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_ATOMIC)
&& (TREE_CODE (type) == REFERENCE_TYPE
|| TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE))
{
if (TREE_CODE (type) == REFERENCE_TYPE)
! bad_quals |= type_quals
! & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_ATOMIC);
! type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_ATOMIC);
}
/* But preserve any function-cv-quals on a FUNCTION_TYPE. */
*************** cv_unqualified (tree type)
return type;
quals = cp_type_quals (type);
! quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
return cp_build_qualified_type (type, quals);
}
return type;
quals = cp_type_quals (type);
! quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC);
return cp_build_qualified_type (type, quals);
}
===================================================================
*************** build_class_member_access_expr (tree obj
expression itself. */
if (type_quals & TYPE_QUAL_CONST)
TREE_READONLY (result) = 1;
! if (type_quals & TYPE_QUAL_VOLATILE)
TREE_THIS_VOLATILE (result) = 1;
}
else if (BASELINK_P (member))
expression itself. */
if (type_quals & TYPE_QUAL_CONST)
TREE_READONLY (result) = 1;
! if (type_quals & (TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC))
TREE_THIS_VOLATILE (result) = 1;
}
else if (BASELINK_P (member))
*************** cp_build_indirect_ref (tree ptr, ref_ope
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
TREE_READONLY (ref) = CP_TYPE_CONST_P (t);
! TREE_THIS_VOLATILE (ref) = CP_TYPE_VOLATILE_P (t);
TREE_SIDE_EFFECTS (ref)
= (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (pointer));
return ref;
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
TREE_READONLY (ref) = CP_TYPE_CONST_P (t);
! TREE_THIS_VOLATILE (ref) = (CP_TYPE_VOLATILE_P (t)
! || CP_TYPE_ATOMIC_P (t));
TREE_SIDE_EFFECTS (ref)
= (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (pointer));
return ref;
*************** cp_build_array_ref (location_t loc, tree
TREE_READONLY (rval)
|= (CP_TYPE_CONST_P (type) | TREE_READONLY (array));
TREE_SIDE_EFFECTS (rval)
! |= (CP_TYPE_VOLATILE_P (type) | TREE_SIDE_EFFECTS (array));
TREE_THIS_VOLATILE (rval)
! |= (CP_TYPE_VOLATILE_P (type) | TREE_THIS_VOLATILE (array));
ret = require_complete_type_sfinae (fold_if_not_in_template (rval),
complain);
protected_set_expr_location (ret, loc);
TREE_READONLY (rval)
|= (CP_TYPE_CONST_P (type) | TREE_READONLY (array));
TREE_SIDE_EFFECTS (rval)
! |= (CP_TYPE_VOLATILE_P (type) | TREE_SIDE_EFFECTS (array)
! | CP_TYPE_ATOMIC_P (type));
TREE_THIS_VOLATILE (rval)
! |= (CP_TYPE_VOLATILE_P (type) | TREE_THIS_VOLATILE (array)
! | CP_TYPE_ATOMIC_P (type));
ret = require_complete_type_sfinae (fold_if_not_in_template (rval),
complain);
protected_set_expr_location (ret, loc);
*************** check_return_expr (tree retval, bool *no
&& same_type_p ((TYPE_MAIN_VARIANT (TREE_TYPE (retval))),
(TYPE_MAIN_VARIANT (functype)))
/* And the returned value must be non-volatile. */
! && ! TYPE_VOLATILE (TREE_TYPE (retval)));
if (fn_returns_value_p && flag_elide_constructors)
{
&& same_type_p ((TYPE_MAIN_VARIANT (TREE_TYPE (retval))),
(TYPE_MAIN_VARIANT (functype)))
/* And the returned value must be non-volatile. */
! && ! TYPE_VOLATILE (TREE_TYPE (retval))
! && ! TYPE_ATOMIC (TREE_TYPE (retval)));
if (fn_returns_value_p && flag_elide_constructors)
{
*************** cp_type_quals (const_tree type)
/* METHOD and REFERENCE_TYPEs should never have quals. */
gcc_assert ((TREE_CODE (type) != METHOD_TYPE
&& TREE_CODE (type) != REFERENCE_TYPE)
! || ((quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE))
== TYPE_UNQUALIFIED));
return quals;
}
/* METHOD and REFERENCE_TYPEs should never have quals. */
gcc_assert ((TREE_CODE (type) != METHOD_TYPE
&& TREE_CODE (type) != REFERENCE_TYPE)
! || ((quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC))
== TYPE_UNQUALIFIED));
return quals;
}
*************** bool
cv_qualified_p (const_tree type)
{
int quals = cp_type_quals (type);
! return (quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE)) != 0;
}
/* Returns nonzero if the TYPE contains a mutable member. */
cv_qualified_p (const_tree type)
{
int quals = cp_type_quals (type);
! return (quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC)) != 0;
}
/* Returns nonzero if the TYPE contains a mutable member. */
===================================================================
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
// atomic_char32_t char32_t
// atomic_wchar_t wchar_t
//
! // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or
! // 8 bytes, since that is what GCC built-in functions for atomic
// memory access expect.
template<typename _ITp>
struct __atomic_base
{
private:
! typedef _ITp __int_type;
! __int_type _M_i;
public:
__atomic_base() noexcept = default;
// atomic_char32_t char32_t
// atomic_wchar_t wchar_t
//
! // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, 8, or
! // 16 bytes, since that is what GCC built-in functions for atomic
// memory access expect.
template<typename _ITp>
struct __atomic_base
{
private:
! typedef _ITp __int_type;
! typedef _ITp __attribute__ ((atomic)) __atomic_int_type;
! __atomic_int_type _M_i;
public:
__atomic_base() noexcept = default;
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __atomic_base<_PTp*>
{
private:
! typedef _PTp* __pointer_type;
! __pointer_type _M_p;
// Factored out to facilitate explicit specialization.
constexpr ptrdiff_t
struct __atomic_base<_PTp*>
{
private:
! typedef _PTp* __pointer_type;
! typedef _PTp* __attribute ((atomic)) __atomic_pointer_type;
! __atomic_pointer_type _M_p;
// Factored out to facilitate explicit specialization.
constexpr ptrdiff_t
===================================================================
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct atomic
{
private:
! _Tp _M_i;
public:
atomic() noexcept = default;
struct atomic
{
private:
! _Tp __attribute ((atomic)) _M_i;
public:
atomic() noexcept = default;
===================================================================
*************** DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PT
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
+ DEF_PRIMITIVE_TYPE (BT_ATOMIC_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC)))
+ DEF_PRIMITIVE_TYPE (BT_CONST_ATOMIC_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST|TYPE_QUAL_ATOMIC)))
DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
DEF_POINTER_TYPE (BT_PTR_ULONGLONG, BT_ULONGLONG)
DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR)
*************** DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_VPTR
BT_INT)
DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_INT, BT_VOID, BT_VOLATILE_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_VPTR_INT, BT_BOOL, BT_VOLATILE_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_VPTR, BT_BOOL, BT_SIZE,
! BT_CONST_VOLATILE_PTR)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
BT_INT)
DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I1_CONST_APTR_INT, BT_I1, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I2_CONST_APTR_INT, BT_I2, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I4_CONST_APTR_INT, BT_I4, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_APTR_INT, BT_I8, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_APTR_INT, BT_I16, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_VOID_APTR_INT, BT_VOID, BT_ATOMIC_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_APTR_INT, BT_BOOL, BT_ATOMIC_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_APTR, BT_BOOL, BT_SIZE,
! BT_CONST_ATOMIC_PTR)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
*************** DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_IN
DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_INT)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
! DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I1_APTR_I1_INT, BT_I1, BT_ATOMIC_PTR, BT_I1, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I2_APTR_I2_INT, BT_I2, BT_ATOMIC_PTR, BT_I2, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I4_APTR_I4_INT, BT_I4, BT_ATOMIC_PTR, BT_I4, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I8_APTR_I8_INT, BT_I8, BT_ATOMIC_PTR, BT_I8, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I16_APTR_I16_INT, BT_I16, BT_ATOMIC_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I1_INT, BT_VOID, BT_ATOMIC_PTR, BT_I1, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I2_INT, BT_VOID, BT_ATOMIC_PTR, BT_I2, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I4_INT, BT_VOID, BT_ATOMIC_PTR, BT_I4, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I8_INT, BT_VOID, BT_ATOMIC_PTR, BT_I8, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I16_INT, BT_VOID, BT_ATOMIC_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_APTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_INT)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_APTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_CONST_ATOMIC_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
! DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_APTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
*************** DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PT
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I1_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I2_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I4_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I8_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I16_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_APTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
===================================================================
*************** DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PT
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
+ DEF_PRIMITIVE_TYPE (BT_ATOMIC_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_ATOMIC)))
+ DEF_PRIMITIVE_TYPE (BT_CONST_ATOMIC_PTR,
+ build_pointer_type
+ (build_qualified_type (void_type_node,
+ TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST|TYPE_QUAL_ATOMIC)))
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
*************** DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT32_DFLO
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT64_DFLOAT64, BT_DFLOAT64, BT_DFLOAT64)
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFLOAT128, BT_DFLOAT128, BT_DFLOAT128)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
+ DEF_FUNCTION_TYPE_1 (BT_FN_VOID_APTR, BT_VOID, BT_ATOMIC_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG)
*************** DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_VPTR
BT_INT)
DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_INT, BT_VOID, BT_VOLATILE_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_VPTR_INT, BT_BOOL, BT_VOLATILE_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_VPTR, BT_BOOL, BT_SIZE,
! BT_CONST_VOLATILE_PTR)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
BT_INT)
DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I1_CONST_APTR_INT, BT_I1, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I2_CONST_APTR_INT, BT_I2, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I4_CONST_APTR_INT, BT_I4, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_APTR_INT, BT_I8, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_APTR_INT, BT_I16, BT_CONST_ATOMIC_PTR,
! BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_VOID_APTR_INT, BT_VOID, BT_ATOMIC_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_APTR_INT, BT_BOOL, BT_ATOMIC_PTR, BT_INT)
! DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_APTR, BT_BOOL, BT_SIZE,
! BT_CONST_ATOMIC_PTR)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
*************** DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_IN
DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I1_APTR_I1_INT, BT_I1, BT_ATOMIC_PTR, BT_I1, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I2_APTR_I2_INT, BT_I2, BT_ATOMIC_PTR, BT_I2, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I4_APTR_I4_INT, BT_I4, BT_ATOMIC_PTR, BT_I4, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I8_APTR_I8_INT, BT_I8, BT_ATOMIC_PTR, BT_I8, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_I16_APTR_I16_INT, BT_I16, BT_ATOMIC_PTR, BT_I16, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I1_INT, BT_VOID, BT_ATOMIC_PTR, BT_I1, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I2_INT, BT_VOID, BT_ATOMIC_PTR, BT_I2, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I4_INT, BT_VOID, BT_ATOMIC_PTR, BT_I4, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I8_INT, BT_VOID, BT_ATOMIC_PTR, BT_I8, BT_INT)
+ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_APTR_I16_INT, BT_VOID, BT_ATOMIC_PTR, BT_I16, BT_INT)
+
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
*************** DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PT
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_INT)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING,
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_APTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_INT)
! DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_APTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_CONST_ATOMIC_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING,
*************** DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_IN
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
! DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
BT_PTR_LONG, BT_PTR_LONG)
! DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_APTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_PTR, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
*************** DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PT
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
! BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
! BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I1_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I2_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I4_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I8_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_APTR_PTR_I16_BOOL_INT_INT,
! BT_BOOL, BT_ATOMIC_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
BT_INT)
! DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_APTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
! BT_ATOMIC_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
===================================================================
*************** DEF_SYNC_BUILTIN (BUILT_IN_SYNC_SYNCHRON
/* __sync* builtins for the C++ memory model. */
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_TEST_AND_SET, "__atomic_test_and_set",
! BT_FN_BOOL_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
! DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_CLEAR, "__atomic_clear", BT_FN_VOID_VPTR_INT,
ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE,
"__atomic_exchange",
! BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_N,
"__atomic_exchange_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_1,
"__atomic_exchange_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_2,
"__atomic_exchange_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_4,
"__atomic_exchange_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_8,
"__atomic_exchange_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_16,
"__atomic_exchange_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD,
"__atomic_load",
! BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_N,
"__atomic_load_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_1,
"__atomic_load_1",
! BT_FN_I1_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_2,
"__atomic_load_2",
! BT_FN_I2_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_4,
"__atomic_load_4",
! BT_FN_I4_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_8,
"__atomic_load_8",
! BT_FN_I8_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_16,
"__atomic_load_16",
! BT_FN_I16_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE,
"__atomic_compare_exchange",
! BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT,
ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N,
"__atomic_compare_exchange_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1,
"__atomic_compare_exchange_1",
! BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_2,
"__atomic_compare_exchange_2",
! BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_4,
"__atomic_compare_exchange_4",
! BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_8,
"__atomic_compare_exchange_8",
! BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_16,
"__atomic_compare_exchange_16",
! BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE,
"__atomic_store",
! BT_FN_VOID_SIZE_VPTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_N,
"__atomic_store_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_1,
"__atomic_store_1",
! BT_FN_VOID_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_2,
"__atomic_store_2",
! BT_FN_VOID_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_4,
"__atomic_store_4",
! BT_FN_VOID_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_8,
"__atomic_store_8",
! BT_FN_VOID_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_16,
"__atomic_store_16",
! BT_FN_VOID_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_N,
"__atomic_add_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_1,
"__atomic_add_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_2,
"__atomic_add_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_4,
"__atomic_add_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_8,
"__atomic_add_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_16,
"__atomic_add_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_N,
"__atomic_sub_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_1,
"__atomic_sub_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_2,
"__atomic_sub_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_4,
"__atomic_sub_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_8,
"__atomic_sub_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_16,
"__atomic_sub_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_N,
"__atomic_and_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_1,
"__atomic_and_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_2,
"__atomic_and_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_4,
"__atomic_and_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_8,
"__atomic_and_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_16,
"__atomic_and_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_N,
"__atomic_nand_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_1,
"__atomic_nand_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_2,
"__atomic_nand_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_4,
"__atomic_nand_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_8,
"__atomic_nand_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_16,
"__atomic_nand_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_N,
"__atomic_xor_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_1,
"__atomic_xor_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_2,
"__atomic_xor_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_4,
"__atomic_xor_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_8,
"__atomic_xor_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_16,
"__atomic_xor_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_N,
"__atomic_or_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_1,
"__atomic_or_fetch_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_2,
"__atomic_or_fetch_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_4,
"__atomic_or_fetch_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_8,
"__atomic_or_fetch_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_16,
"__atomic_or_fetch_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_N,
"__atomic_fetch_add",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_1,
"__atomic_fetch_add_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_2,
"__atomic_fetch_add_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_4,
"__atomic_fetch_add_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_8,
"__atomic_fetch_add_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_16,
"__atomic_fetch_add_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_N,
"__atomic_fetch_sub",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_1,
"__atomic_fetch_sub_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_2,
"__atomic_fetch_sub_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_4,
"__atomic_fetch_sub_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_8,
"__atomic_fetch_sub_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_16,
"__atomic_fetch_sub_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_N,
"__atomic_fetch_and",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_1,
"__atomic_fetch_and_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_2,
"__atomic_fetch_and_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_4,
"__atomic_fetch_and_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_8,
"__atomic_fetch_and_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_16,
"__atomic_fetch_and_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_N,
"__atomic_fetch_nand",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_1,
"__atomic_fetch_nand_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_2,
"__atomic_fetch_nand_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_4,
"__atomic_fetch_nand_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_8,
"__atomic_fetch_nand_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_16,
"__atomic_fetch_nand_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_N,
"__atomic_fetch_xor",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_1,
"__atomic_fetch_xor_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_2,
"__atomic_fetch_xor_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_4,
"__atomic_fetch_xor_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_8,
"__atomic_fetch_xor_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_16,
"__atomic_fetch_xor_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_N,
/* __sync* builtins for the C++ memory model. */
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_TEST_AND_SET, "__atomic_test_and_set",
! BT_FN_BOOL_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
! DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_CLEAR, "__atomic_clear", BT_FN_VOID_APTR_INT,
ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE,
"__atomic_exchange",
! BT_FN_VOID_SIZE_APTR_PTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_N,
"__atomic_exchange_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_1,
"__atomic_exchange_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_2,
"__atomic_exchange_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_4,
"__atomic_exchange_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_8,
"__atomic_exchange_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE_16,
"__atomic_exchange_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD,
"__atomic_load",
! BT_FN_VOID_SIZE_CONST_APTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_N,
"__atomic_load_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_1,
"__atomic_load_1",
! BT_FN_I1_CONST_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_2,
"__atomic_load_2",
! BT_FN_I2_CONST_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_4,
"__atomic_load_4",
! BT_FN_I4_CONST_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_8,
"__atomic_load_8",
! BT_FN_I8_CONST_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_16,
"__atomic_load_16",
! BT_FN_I16_CONST_APTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE,
"__atomic_compare_exchange",
! BT_FN_BOOL_SIZE_APTR_PTR_PTR_INT_INT,
ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N,
"__atomic_compare_exchange_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1,
"__atomic_compare_exchange_1",
! BT_FN_BOOL_APTR_PTR_I1_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_2,
"__atomic_compare_exchange_2",
! BT_FN_BOOL_APTR_PTR_I2_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_4,
"__atomic_compare_exchange_4",
! BT_FN_BOOL_APTR_PTR_I4_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_8,
"__atomic_compare_exchange_8",
! BT_FN_BOOL_APTR_PTR_I8_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_16,
"__atomic_compare_exchange_16",
! BT_FN_BOOL_APTR_PTR_I16_BOOL_INT_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE,
"__atomic_store",
! BT_FN_VOID_SIZE_APTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_N,
"__atomic_store_n",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_1,
"__atomic_store_1",
! BT_FN_VOID_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_2,
"__atomic_store_2",
! BT_FN_VOID_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_4,
"__atomic_store_4",
! BT_FN_VOID_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_8,
"__atomic_store_8",
! BT_FN_VOID_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_STORE_16,
"__atomic_store_16",
! BT_FN_VOID_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_N,
"__atomic_add_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_1,
"__atomic_add_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_2,
"__atomic_add_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_4,
"__atomic_add_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_8,
"__atomic_add_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ADD_FETCH_16,
"__atomic_add_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_N,
"__atomic_sub_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_1,
"__atomic_sub_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_2,
"__atomic_sub_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_4,
"__atomic_sub_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_8,
"__atomic_sub_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_SUB_FETCH_16,
"__atomic_sub_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_N,
"__atomic_and_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_1,
"__atomic_and_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_2,
"__atomic_and_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_4,
"__atomic_and_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_8,
"__atomic_and_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_AND_FETCH_16,
"__atomic_and_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_N,
"__atomic_nand_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_1,
"__atomic_nand_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_2,
"__atomic_nand_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_4,
"__atomic_nand_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_8,
"__atomic_nand_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_NAND_FETCH_16,
"__atomic_nand_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_N,
"__atomic_xor_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_1,
"__atomic_xor_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_2,
"__atomic_xor_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_4,
"__atomic_xor_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_8,
"__atomic_xor_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_XOR_FETCH_16,
"__atomic_xor_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_N,
"__atomic_or_fetch",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_1,
"__atomic_or_fetch_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_2,
"__atomic_or_fetch_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_4,
"__atomic_or_fetch_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_8,
"__atomic_or_fetch_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_OR_FETCH_16,
"__atomic_or_fetch_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_N,
"__atomic_fetch_add",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_1,
"__atomic_fetch_add_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_2,
"__atomic_fetch_add_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_4,
"__atomic_fetch_add_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_8,
"__atomic_fetch_add_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_ADD_16,
"__atomic_fetch_add_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_N,
"__atomic_fetch_sub",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_1,
"__atomic_fetch_sub_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_2,
"__atomic_fetch_sub_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_4,
"__atomic_fetch_sub_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_8,
"__atomic_fetch_sub_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_SUB_16,
"__atomic_fetch_sub_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_N,
"__atomic_fetch_and",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_1,
"__atomic_fetch_and_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_2,
"__atomic_fetch_and_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_4,
"__atomic_fetch_and_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_8,
"__atomic_fetch_and_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_AND_16,
"__atomic_fetch_and_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_N,
"__atomic_fetch_nand",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_1,
"__atomic_fetch_nand_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_2,
"__atomic_fetch_nand_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_4,
"__atomic_fetch_nand_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_8,
"__atomic_fetch_nand_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_NAND_16,
"__atomic_fetch_nand_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_N,
"__atomic_fetch_xor",
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_1,
"__atomic_fetch_xor_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_2,
"__atomic_fetch_xor_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_4,
"__atomic_fetch_xor_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_8,
"__atomic_fetch_xor_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_XOR_16,
"__atomic_fetch_xor_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_N,
*************** DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_1,
"__atomic_fetch_or_1",
! BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_2,
"__atomic_fetch_or_2",
! BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_4,
"__atomic_fetch_or_4",
! BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_8,
"__atomic_fetch_or_8",
! BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_16,
"__atomic_fetch_or_16",
! BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE,
"__atomic_always_lock_free",
! BT_FN_BOOL_SIZE_CONST_VPTR, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_IS_LOCK_FREE,
"__atomic_is_lock_free",
! BT_FN_BOOL_SIZE_CONST_VPTR, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_THREAD_FENCE,
BT_FN_VOID_VAR, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_1,
"__atomic_fetch_or_1",
! BT_FN_I1_APTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_2,
"__atomic_fetch_or_2",
! BT_FN_I2_APTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_4,
"__atomic_fetch_or_4",
! BT_FN_I4_APTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_8,
"__atomic_fetch_or_8",
! BT_FN_I8_APTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_FETCH_OR_16,
"__atomic_fetch_or_16",
! BT_FN_I16_APTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE,
"__atomic_always_lock_free",
! BT_FN_BOOL_SIZE_CONST_APTR, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_IS_LOCK_FREE,
"__atomic_is_lock_free",
! BT_FN_BOOL_SIZE_CONST_APTR, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_THREAD_FENCE,
===================================================================
*************** This macro holds if the type is @code{co
@item CP_TYPE_VOLATILE_P
This macro holds if the type is @code{volatile}-qualified.
+ @item CP_TYPE_ATOMIC_P
+ This macro holds if the type is @code{atomic}-qualified.
+
@item CP_TYPE_RESTRICT_P
This macro holds if the type is @code{restrict}-qualified.
===================================================================
*************** It returns true if the target supports G
The support includes the assembler, linker and dynamic linker.
The default value of this hook is based on target's libc.
@end deftypefn
+
+ @deftypefn {Target Hook} {unsigned int} TARGET_ATOMIC_ALIGN_FOR_MODE (enum machine_mode @var{mode})
+ If defined, this function returns an appropriate alignment in bits for an atomic object of machine_mode @var{mode}. If 0 is returned then the default alignment for the specified mode is used.
+ @end deftypefn
===================================================================
*************** and the associated definitions of those
@hook TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
@hook TARGET_HAS_IFUNC_P
+
+ @hook TARGET_ATOMIC_ALIGN_FOR_MODE
===================================================================
***************
extern void abort(void);
! char v, count, ret;
main ()
{
extern void abort(void);
! char __attribute__ ((atomic)) v;
! char count, ret;
main ()
{
===================================================================
***************
extern void abort(void);
! short v, count, ret;
main ()
{
extern void abort(void);
! short __attribute__ ((atomic)) v;
! short count, ret;
main ()
{
===================================================================
***************
extern void abort(void);
! int v, count, ret;
main ()
{
extern void abort(void);
! int __attribute__ ((atomic)) v;
! int count, ret;
main ()
{
===================================================================
***************
extern void abort(void);
! long long v, count, ret;
main ()
{
extern void abort(void);
! long long __attribute__ ((atomic)) v;
! long long count, ret;
main ()
{
===================================================================
***************
extern void abort(void);
! __int128_t v, count, ret;
main ()
{
extern void abort(void);
! __int128_t __attribute__ ((atomic)) v;
! __int128_t count, ret;
main ()
{
===================================================================
***************
/* Test __atomic routines for existence and proper execution on 1 byte
values with each valid memory model. */
/* { dg-do run } */
/* { dg-require-effective-target sync_char_short } */
/* Test the execution of the __atomic_*OP builtin routines for a char. */
extern void abort(void);
! char v, count, res;
const char init = ~0;
/* The fetch_op routines return the original value before the operation. */
/* Test __atomic routines for existence and proper execution on 1 byte
values with each valid memory model. */
/* { dg-do run } */
+ /* { dg-options "--std=c11" } */
/* { dg-require-effective-target sync_char_short } */
/* Test the execution of the __atomic_*OP builtin routines for a char. */
extern void abort(void);
! _Atomic char v;
! char count, res;
const char init = ~0;
/* The fetch_op routines return the original value before the operation. */
*************** test_or ()
abort ();
}
+ int
main ()
{
test_fetch_add ();
===================================================================
***************
/* Test __atomic routines for existence and proper execution on 2 byte
values with each valid memory model. */
/* { dg-do run } */
+ /* { dg-options "--std=c11" } */
/* { dg-require-effective-target sync_char_short } */
***************
extern void abort(void);
! short v, count, res;
const short init = ~0;
/* The fetch_op routines return the original value before the operation. */
extern void abort(void);
! _Atomic short v;
! short count, res;
const short init = ~0;
/* The fetch_op routines return the original value before the operation. */
*************** test_or ()
abort ();
}
+ int
main ()
{
test_fetch_add ();
===================================================================
***************
/* Test __atomic routines for existence and proper execution on 4 byte
values with each valid memory model. */
/* { dg-do run } */
/* { dg-require-effective-target sync_int_long } */
/* Test the execution of the __atomic_*OP builtin routines for an int. */
extern void abort(void);
! int v, count, res;
const int init = ~0;
/* The fetch_op routines return the original value before the operation. */
/* Test __atomic routines for existence and proper execution on 4 byte
values with each valid memory model. */
/* { dg-do run } */
+ /* { dg-options "--std=c11" } */
/* { dg-require-effective-target sync_int_long } */
/* Test the execution of the __atomic_*OP builtin routines for an int. */
extern void abort(void);
! _Atomic int v;
! int count, res;
const int init = ~0;
/* The fetch_op routines return the original value before the operation. */
*************** test_or ()
abort ();
}
+ int
main ()
{
test_fetch_add ();
===================================================================
***************
values with each valid memory model. */
/* { dg-do run } */
/* { dg-require-effective-target sync_long_long_runtime } */
! /* { dg-options "" } */
! /* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* Test the execution of the __atomic_*OP builtin routines for long long. */
extern void abort(void);
! long long v, count, res;
const long long init = ~0;
/* The fetch_op routines return the original value before the operation. */
values with each valid memory model. */
/* { dg-do run } */
/* { dg-require-effective-target sync_long_long_runtime } */
! /* { dg-options "--std=c11" } */
! /* { dg-options "--std=c11 -march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* Test the execution of the __atomic_*OP builtin routines for long long. */
extern void abort(void);
! _Atomic long long v;
! long long count, res;
const long long init = ~0;
/* The fetch_op routines return the original value before the operation. */
*************** test_or ()
abort ();
}
+ int
main ()
{
test_fetch_add ();
===================================================================
***************
/* Test __atomic routines for existence and proper execution on 16 byte
values with each valid memory model. */
/* { dg-do run } */
/* { dg-require-effective-target sync_int_128_runtime } */
! /* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
/* Test the execution of the __atomic_*OP builtin routines for an int_128. */
extern void abort(void);
! __int128_t v, count, res;
const __int128_t init = ~0;
/* The fetch_op routines return the original value before the operation. */
/* Test __atomic routines for existence and proper execution on 16 byte
values with each valid memory model. */
/* { dg-do run } */
+ /* { dg-options "--std=c11" } */
/* { dg-require-effective-target sync_int_128_runtime } */
! /* { dg-options "--std=c11 -mcx16" { target { i?86-*-* x86_64-*-* } } } */
/* Test the execution of the __atomic_*OP builtin routines for an int_128. */
extern void abort(void);
! _Atomic __int128_t v;
! __int128_t count, res;
const __int128_t init = ~0;
/* The fetch_op routines return the original value before the operation. */
*************** test_or ()
abort ();
}
+ int
main ()
{
test_fetch_add ();