aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2013-11-22 16:19:21 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2013-11-22 16:19:21 +0000
commitfceec4d3d738b29c5e5c6d5dadd64c096f053f6a (patch)
tree6046b2c41ea50ac794232280ab4a1997a352faa9 /gcc/tree.c
parent2fb9a547b4c0a5abb0dedb0ffd8848cd7f86bd82 (diff)
downloadgcc-fceec4d3d738b29c5e5c6d5dadd64c096f053f6a.zip
gcc-fceec4d3d738b29c5e5c6d5dadd64c096f053f6a.tar.gz
gcc-fceec4d3d738b29c5e5c6d5dadd64c096f053f6a.tar.bz2
hooks.h (hook_uint_mode_0): Add Prototype.
* hooks.h (hook_uint_mode_0): Add Prototype. * hooks.c (hook_uint_mode_0): New default function. * target.def (atomic_align_for_mode): New target hook. * tree.c (build_atomic_base): Add alignment override parameter. (build_common_tree_nodes): Use atomic alignment override. * doc/tm.texi.in (TARGET_ATOMIC_ALIGN_FOR_MODE): Define. * doc/tm.texi (TARGET_ATOMIC_ALIGN_FOR_MODE): Add description. From-SVN: r205273
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index e81662e..d363cfc 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -9550,10 +9550,11 @@ make_or_reuse_accum_type (unsigned size, int unsignedp, int satp)
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. */
+ called from there. If ALIGN is non-zero, then ensure alignment is
+ overridden to this value. */
static tree
-build_atomic_base (tree type)
+build_atomic_base (tree type, unsigned int align)
{
tree t;
@@ -9564,6 +9565,9 @@ build_atomic_base (tree type)
t = build_variant_type_copy (type);
set_type_quals (t, TYPE_QUAL_ATOMIC);
+ if (align)
+ TYPE_ALIGN (t) = align;
+
return t;
}
@@ -9651,14 +9655,21 @@ build_common_tree_nodes (bool signed_char, bool short_double)
/* Don't call build_qualified type for atomics. That routine does
special processing for atomics, and until they are initialized
- it's better not to make that call. */
-
- atomicQI_type_node = build_atomic_base (unsigned_intQI_type_node);
- atomicHI_type_node = build_atomic_base (unsigned_intHI_type_node);
- atomicSI_type_node = build_atomic_base (unsigned_intSI_type_node);
- atomicDI_type_node = build_atomic_base (unsigned_intDI_type_node);
- atomicTI_type_node = build_atomic_base (unsigned_intTI_type_node);
-
+ it's better not to make that call.
+
+ Check to see if there is a target override for atomic types. */
+
+ atomicQI_type_node = build_atomic_base (unsigned_intQI_type_node,
+ targetm.atomic_align_for_mode (QImode));
+ atomicHI_type_node = build_atomic_base (unsigned_intHI_type_node,
+ targetm.atomic_align_for_mode (HImode));
+ atomicSI_type_node = build_atomic_base (unsigned_intSI_type_node,
+ targetm.atomic_align_for_mode (SImode));
+ atomicDI_type_node = build_atomic_base (unsigned_intDI_type_node,
+ targetm.atomic_align_for_mode (DImode));
+ atomicTI_type_node = build_atomic_base (unsigned_intTI_type_node,
+ targetm.atomic_align_for_mode (TImode));
+
access_public_node = get_identifier ("public");
access_protected_node = get_identifier ("protected");
access_private_node = get_identifier ("private");