https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94066
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
We also ICE elsewhere with the following modified testcase:
$ cat 94066.C
union U;
constexpr long foo(U *up);
union U {
long a = foo(this);
int y;
};
constexpr long foo(U *up) {
up->y = 11;
return 42;
}
extern constexpr U u = {};
$ g++ -std=c++17 94066.C
94066.C:15:26: internal compiler error: in output_constructor_regular_field, at
varasm.c:5230
15 | extern constexpr U u = {};
| ^
0x82f159 output_constructor_regular_field
/home/patrick/code/gcc/gcc/varasm.c:5230
0x82f159 output_constructor
/home/patrick/code/gcc/gcc/varasm.c:5536
0x1375894 output_constant
/home/patrick/code/gcc/gcc/varasm.c:4908
0x1375894 assemble_variable_contents
/home/patrick/code/gcc/gcc/varasm.c:2148
0x137e152 assemble_variable(tree_node*, int, int, int)
/home/patrick/code/gcc/gcc/varasm.c:2327
0x1380c79 varpool_node::assemble_decl()
/home/patrick/code/gcc/gcc/varpool.c:587
0xc209ec output_in_order
/home/patrick/code/gcc/gcc/cgraphunit.c:2564
0xc209ec symbol_table::compile()
/home/patrick/code/gcc/gcc/cgraphunit.c:2801
0xc22eec symbol_table::compile()
/home/patrick/code/gcc/gcc/cgraphunit.c:2717
0xc22eec symbol_table::finalize_compilation_unit()
/home/patrick/code/gcc/gcc/cgraphunit.c:2984