https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111075
--- Comment #1 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> --- Preprocessed source: % cat a-tail-padding1.ii # 0 "/Users/fx/gcc-upstream/gcc/testsuite/g++.dg/torture/tail-padding1.C" # 0 "<built-in>" # 0 "<command-line>" # 1 "/Users/fx/gcc-upstream/gcc/testsuite/g++.dg/torture/tail-padding1.C" struct X { ~X() {} int n; char d; }; struct Y { Y(); char c[3]; }; struct Z : X, virtual Y { Z(); }; X f() { X nrvo; __builtin_memset(&nrvo, 0, sizeof(X)); return nrvo; } Z::Z() : Y(), X(f()) {} Y::Y() { c[0] = 1; } int main() { Z z; if (z.c[0] != 1) __builtin_abort (); } Backtrace of the ICE: * frame #0: 0x0000000101b76378 cc1plus`internal_error(char const*, ...) [inlined] auto_diagnostic_group::auto_diagnostic_group(this=<unavailable>) at diagnostic.cc:2320:14 frame #1: 0x0000000101b76378 cc1plus`internal_error(gmsgid="in %s, at %s:%d") frame #2: 0x0000000101f92296 cc1plus`fancy_abort(file="/Users/fx/gcc-upstream/gcc/cp/constexpr.cc", line=2918, function="cxx_eval_call_expression") at diagnostic.cc:2311:18 frame #3: 0x0000000101c8254e cc1plus`::__second_sect_of_cxx_eval_call_expression() at constexpr.cc:2918:3 frame #4: 0x0000000100054f3b cc1plus`::cxx_eval_constant_expression(ctx=0x00007ff7bfefe500, t=<unavailable>, lval=vc_prvalue, non_constant_p=0x00007ff7bfefe4ee, overflow_p=0x00007ff7bfefe4ef, jump_target=0x0000000000000000) at constexpr.cc:7257:36 frame #5: 0x0000000100060156 cc1plus`::cxx_eval_outermost_constant_expr(t=0x00000001045b9880, allow_non_constant=true, strict=<unavailable>, manifestly_const_eval=mce_false, constexpr_dtor=false, object=0x0000000000000000) at constexpr.cc:8500:36 frame #6: 0x000000010006601c cc1plus`maybe_constant_value(t=<unavailable>, decl=0x0000000000000000, manifestly_const_eval=mce_false) at constexpr.cc:8788:45 frame #7: 0x0000000100091cf1 cc1plus`::cp_fold(x=<unavailable>, flags=<unavailable>) at cp-gimplify.cc:3052:31 frame #8: 0x0000000100091f46 cc1plus`::cp_fold_r(stmt_p=0x00000001045a3ca0, walk_subtrees=0x00007ff7bfefe8dc, data_=0x00007ff7bfefe9a0) at cp-gimplify.cc:1077:28 frame #9: 0x0000000101952268 cc1plus`walk_tree_1(tp=<unavailable>, func=<unavailable>, data=0x00007ff7bfefe9a0, pset=<unavailable>, lh=(cc1plus`cp_walk_subtrees(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*) at tree.cc:5453:1))(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) at tree.cc:11398:25 frame #10: 0x0000000101952f0a cc1plus`walk_tree_1(tp=<unavailable>, func=<unavailable>, data=0x00007ff7bfefe9a0, pset=<unavailable>, lh=(cc1plus`cp_walk_subtrees(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*) at tree.cc:5453:1))(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) at tree.cc:11514:4 frame #11: 0x0000000100087c18 cc1plus`cp_fold_function(fndecl=0x00000001045be000) at cp-gimplify.cc:1199:3 frame #12: 0x00000001000dc0b9 cc1plus`finish_function(inline_p=<unavailable>) at decl.cc:18345:22 frame #13: 0x00000001001938bf cc1plus`::maybe_thunk_body(fn=0x00000001045b4e00, force=<unavailable>) at optimize.cc:445:26 frame #14: 0x000000010019443a cc1plus`maybe_clone_body(fn=0x00000001045b4e00) at optimize.cc:557:38 frame #15: 0x0000000100278978 cc1plus`expand_or_defer_fn_1(fn=0x00000001045b4e00) at semantics.cc:4901:24 frame #16: 0x0000000100278c5e cc1plus`expand_or_defer_fn(fn=0x00000001045b4e00) at semantics.cc:4932:28 frame #17: 0x000000010013c6d8 cc1plus`synthesize_method(fndecl=<unavailable>) at method.cc:1842:24 frame #18: 0x00000001000ee7c2 cc1plus`mark_used(decl=0x00000001045be000, complain=<unavailable>) at decl2.cc:5855:25 frame #19: 0x000000010002016b cc1plus`::build_over_call(cand=<unavailable>, flags=<unavailable>, complain=3) at call.cc:10403:21 frame #20: 0x000000010001d900 cc1plus`build_new_method_call(instance=0x00000001044305d0, fns=0x0000000104591f20, args=<unavailable>, conversion_path=<unavailable>, flags=1, fn_p=0x0000000000000000, complain=3) at call.cc:11710:31 frame #21: 0x000000010001eac0 cc1plus`build_special_member_call(instance=<unavailable>, name=0x0000000104422100, args=0x00007ff7bfeff110, binfo=<unavailable>, flags=1, complain=3) at call.cc:11190:31 frame #22: 0x000000010010fc1d cc1plus`::expand_aggr_init_1(tree, tree, tree, tree, int, tsubst_flags_t) at init.cc:2203:40 frame #23: 0x000000010010fb34 cc1plus`::expand_aggr_init_1(binfo=0x00000001045b02a0, true_exp=0x0000000000000000, exp=0x00000001044305d0, init=<unavailable>, flags=1, complain=3) frame #24: 0x0000000100117964 cc1plus`emit_mem_initializers(mem_inits=<unavailable>) at init.cc:1562:23 frame #25: 0x00000001001ebec0 cc1plus`::cp_parser_ctor_initializer_opt_and_function_body(parser=0x00000001045ac150, in_function_try_block=false) at parser.cc:17188:29 frame #26: 0x00000001001ed6e0 cc1plus`::cp_parser_function_definition_after_declarator(parser=0x00000001045ac150, inline_p=false) at parser.cc:32243:7 frame #27: 0x00000001001eecbe cc1plus`::cp_parser_init_declarator(parser=0x00000001045ac150, flags=<unavailable>, decl_specifiers=0x00007ff7bfeff4b0, checks=0x0000000000000000, function_definition_allowed_p=<unavailable>, member_p=false, declares_class_or_enum=0, function_definition_p=0x00007ff7bfeff550, maybe_range_for_decl=0x0000000000000000, init_loc=0x00007ff7bfeff474, auto_result=0x00007ff7bfeff5f0) at parser.cc:32160:59 frame #28: 0x00000001001bcf23 cc1plus`::cp_parser_simple_declaration(parser=0x00000001045ac150, function_definition_allowed_p=<unavailable>, maybe_range_for_decl=0x0000000000000000) at parser.cc:15607:40 frame #29: 0x00000001001f63ed cc1plus`::cp_parser_declaration(parser=0x00000001045ac150, prefix_attrs=0x0000000000000000) at parser.cc:15293:33 frame #30: 0x00000001001f8bf4 cc1plus`c_parse_file() at parser.cc:15314:27 frame #31: 0x000000010034fede cc1plus`c_common_parse_file() at c-opts.cc:1257:20 frame #32: 0x00000001015b5ce4 cc1plus`::compile_file() at toplev.cc:444:25 frame #33: 0x0000000101f96942 cc1plus`toplev::main(this=0x00007ff7bfeff92e, argc=<unavailable>, argv=<unavailable>) at toplev.cc:2126:24 frame #34: 0x0000000101f9712e cc1plus`main(argc=6, argv=0x00007ff7bfeffa78) at main.cc:39:23