aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-04-03 11:02:59 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-04-03 11:02:59 +0000
commit0be1d23cc32369d48c93a795a07d4fa037f14d5c (patch)
treecf22d322ad600e01be8276e666e80baff028b701 /gcc/tree-nested.c
parent79f9fc387d52049546f9ceb43472743d3a1153cc (diff)
downloadgcc-0be1d23cc32369d48c93a795a07d4fa037f14d5c.zip
gcc-0be1d23cc32369d48c93a795a07d4fa037f14d5c.tar.gz
gcc-0be1d23cc32369d48c93a795a07d4fa037f14d5c.tar.bz2
tree-nested.c (get_descriptor_type): Make sure that the alignment of descriptors is at least equal to that of functions.
* tree-nested.c (get_descriptor_type): Make sure that the alignment of descriptors is at least equal to that of functions. From-SVN: r246646
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 4a25025..48022cd 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -496,6 +496,8 @@ static GTY(()) tree descriptor_type;
static tree
get_descriptor_type (struct nesting_info *info)
{
+ /* The base alignment is that of a function. */
+ const unsigned align = FUNCTION_ALIGNMENT (FUNCTION_BOUNDARY);
tree t;
if (descriptor_type)
@@ -505,6 +507,8 @@ get_descriptor_type (struct nesting_info *info)
t = build_array_type (ptr_type_node, t);
t = build_decl (DECL_SOURCE_LOCATION (info->context),
FIELD_DECL, get_identifier ("__data"), t);
+ SET_DECL_ALIGN (t, MAX (TYPE_ALIGN (ptr_type_node), align));
+ DECL_USER_ALIGN (t) = 1;
descriptor_type = make_node (RECORD_TYPE);
TYPE_NAME (descriptor_type) = get_identifier ("__builtin_descriptor");