From 0be1d23cc32369d48c93a795a07d4fa037f14d5c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 3 Apr 2017 11:02:59 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/tree-nested.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9f14aa0049..89b3d0d7def 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-04-03 Eric Botcazou + + * tree-nested.c (get_descriptor_type): Make sure that the alignment of + descriptors is at least equal to that of functions. + 2017-04-02 Uros Bizjak * config/i386/sse.md (movdi_to_sse): Add missing DONE. diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 4a25025ef8f..48022cd4c11 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"); -- 2.30.2