https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102261
Bug ID: 102261
Summary: [12 Regression] ICE: Segmentation fault (in
build_this_conversion)
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
Target: x86_64-unknown-linux-gnu
g++-12.0.0-alpha20210905 snapshot (g:a827909537cf085e5673ca7816b7bd7151d89fc5)
ICEs when compiling the following testcase, extracted from
gcc/testsuite/gcc.target/i386/pr80173.c:
typedef int V __attribute__ ((vector_size (2 * sizeof (int))));
struct U { V a; V b; };
int
bar (int i)
{
register struct U u asm ("xmm7");
u = (struct U) {{-1, 0}, {-1, 0}};
return u.b[i];
}
% x86_64-unknown-linux-gnu-g++-12.0.0 -c lfxfq1vi.cc
lfxfq1vi.cc: In function 'int bar(int)':
lfxfq1vi.cc:9:35: error: address of explicit register variable 'u' requested
9 | u = (struct U) {{-1, 0}, {-1, 0}};
| ^
lfxfq1vi.cc:9:35: internal compiler error: Segmentation fault
0x1143d7f crash_signal
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/toplev.c:328
0x915231 build_this_conversion
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:2291
0x915e53 add_function_candidate
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:2464
0x917186 add_candidates
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:6207
0x92648f add_candidates
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:6076
0x92648f add_operator_candidates
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:6361
0x92677e build_new_op_1
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:6569
0x9275dd build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/call.c:6957
0xb8ceff cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/typeck.c:8936
0xb8d92c build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/typeck.c:9201
0xa8595a cp_parser_assignment_expression
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:10242
0xa870f2 cp_parser_expression
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:10371
0xa8a918 cp_parser_expression_statement
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:12564
0xa96d0a cp_parser_statement
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:12360
0xa97dcd cp_parser_statement_seq_opt
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:12712
0xa97ea8 cp_parser_compound_statement
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:12661
0xab86c0 cp_parser_function_body
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:24854
0xab86c0 cp_parser_ctor_initializer_opt_and_function_body
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:24905
0xab944a cp_parser_function_definition_after_declarator
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:31016
0xaba78b cp_parser_function_definition_from_specifiers_and_declarator
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210905/work/gcc-12-20210905/gcc/cp/parser.c:30932