[Bug c++/65734] Yet another case of lost alignment by stor_layout
hubicka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 10 18:51:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65734
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org,
| |jakub at redhat dot com,
| |jason at redhat dot com
--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
With the following check in stor-laout.c
Index: stor-layout.c
===================================================================
--- stor-layout.c (revision 221977)
+++ stor-layout.c (working copy)
@@ -1831,6 +1831,8 @@ finalize_type_size (tree type)
{
TYPE_SIZE (variant) = size;
TYPE_SIZE_UNIT (variant) = size_unit;
+ if (TYPE_USER_ALIGN (variant))
+ gcc_assert (user_align && TYPE_ALIGN (variant) == align);
TYPE_ALIGN (variant) = align;
TYPE_PRECISION (variant) = precision;
TYPE_USER_ALIGN (variant) = user_align;
I get:
0xa87ace finalize_type_size
../../gcc/stor-layout.c:1835
0xa87bbe finish_record_layout(record_layout_info_s*, int)
../../gcc/stor-layout.c:2079
0x6454bc layout_class_type
../../gcc/cp/class.c:6468
0x6454bc finish_struct_1(tree_node*)
../../gcc/cp/class.c:6598
0x631f4e instantiate_class_template_1
../../gcc/cp/pt.c:9648
0x631f4e instantiate_class_template(tree_node*)
../../gcc/cp/pt.c:9688
0x68a20d complete_type(tree_node*)
../../gcc/cp/typeck.c:146
0x63216c instantiate_class_template_1
../../gcc/cp/pt.c:9469
0x63216c instantiate_class_template(tree_node*)
../../gcc/cp/pt.c:9688
0x68a20d complete_type(tree_node*)
../../gcc/cp/typeck.c:146
0x5f6876 start_decl_1(tree_node*, bool)
../../gcc/cp/decl.c:4900
0x60567f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/cp/decl.c:4863
0x67b646 cp_parser_init_declarator
../../gcc/cp/parser.c:17170
0x67cc1c cp_parser_simple_declaration
../../gcc/cp/parser.c:11607
0x666503 cp_parser_block_declaration
../../gcc/cp/parser.c:11481
0x6860b9 cp_parser_declaration
../../gcc/cp/parser.c:11378
0x6849aa cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:11264
0x684cbf cp_parser_translation_unit
../../gcc/cp/parser.c:4100
0x684cbf c_parse_file()
../../gcc/cp/parser.c:33192
0x736ac2 c_common_parse_file()
../../gcc/c-family/c-opts.c:1057
More information about the Gcc-bugs
mailing list