aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 87e7563..33833a7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -916,10 +916,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
of this type is aligned at least to the alignment of the type, even if it
doesn't appear that it is. We see this, for example, in object-oriented
languages where a tag field may show this is an object of a more-aligned
- variant of the more generic type.
-
- In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
- freelist. */
+ variant of the more generic type. */
#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
/* Used in classes in C++. */
@@ -1865,8 +1862,15 @@ extern machine_mode element_mode (const_tree t);
#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
/* The alignment necessary for objects of this type.
- The value is an int, measured in bits. */
-#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align)
+ The value is an int, measured in bits and must be a power of two.
+ We support also an "alignement" of zero. */
+#define TYPE_ALIGN(NODE) \
+ (TYPE_CHECK (NODE)->type_common.align \
+ ? ((unsigned)1) << ((NODE)->type_common.align - 1) : 0)
+
+/* Specify that TYPE_ALIGN(NODE) is X. */
+#define SET_TYPE_ALIGN(NODE, X) \
+ (TYPE_CHECK (NODE)->type_common.align = ffs_hwi (X))
/* 1 if the alignment for this type was requested by "aligned" attribute,
0 if it is the default for this type. */
@@ -2306,8 +2310,16 @@ extern machine_mode element_mode (const_tree t);
#define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
/* Likewise for the size in bytes. */
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
-/* Holds the alignment required for the datum, in bits. */
-#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
+/* Returns the alignment required for the datum, in bits. It must
+ be a power of two, but an "alignment" of zero is supported
+ (e.g. as "uninitialized" sentinel). */
+#define DECL_ALIGN(NODE) \
+ (DECL_COMMON_CHECK (NODE)->decl_common.align \
+ ? ((unsigned)1) << ((NODE)->decl_common.align - 1) : 0)
+/* Specify that DECL_ALIGN(NODE) is X. */
+#define SET_DECL_ALIGN(NODE, X) \
+ (DECL_COMMON_CHECK (NODE)->decl_common.align = ffs_hwi (X))
+
/* The alignment of NODE, in bytes. */
#define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
/* Set if the alignment of this DECL has been set by the user, for
@@ -2510,7 +2522,7 @@ extern void decl_value_expr_insert (tree, tree);
#define DECL_OFFSET_ALIGN(NODE) \
(((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
-/* Specify that DECL_ALIGN(NODE) is a multiple of X. */
+/* Specify that DECL_OFFSET_ALIGN(NODE) is X. */
#define SET_DECL_OFFSET_ALIGN(NODE, X) \
(FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)