https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104669
Bug ID: 104669
Summary: [11/12 Regression] ICE in is_function_default_version,
at attribs.cc:1219
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Started between 20210314 and 20210328 :
$ cat z1.cc
void bar()
{
int foo();
int foo() __attribute__((target("sse")));
int foo() __attribute__((target("avx")));
int (*p)() = &foo;
return;
}
$ g++-12-20220220 -c z1.cc
z1.cc: In function 'void bar()':
z1.cc:3:10: warning: empty parentheses were disambiguated as a function
declaration [-Wvexing-parse]
3 | int foo();
| ^~
z1.cc:3:10: note: remove parentheses to default-initialize a variable
3 | int foo();
| ^~
| --
z1.cc:3:10: note: or replace parentheses with braces to value-initialize a
variable
z1.cc:4:10: warning: empty parentheses were disambiguated as a function
declaration [-Wvexing-parse]
4 | int foo() __attribute__((target("sse")));
| ^~
z1.cc:4:10: note: remove parentheses to default-initialize a variable
4 | int foo() __attribute__((target("sse")));
| ^~
| --
z1.cc:4:10: note: or replace parentheses with braces to value-initialize a
variable
z1.cc:5:10: warning: empty parentheses were disambiguated as a function
declaration [-Wvexing-parse]
5 | int foo() __attribute__((target("avx")));
| ^~
z1.cc:5:10: note: remove parentheses to default-initialize a variable
5 | int foo() __attribute__((target("avx")));
| ^~
| --
z1.cc:5:10: note: or replace parentheses with braces to value-initialize a
variable
z1.cc:6:17: internal compiler error: in is_function_default_version, at
attribs.cc:1219
6 | int (*p)() = &foo;
| ^~~
0x89edb3 is_function_default_version(tree_node*)
../../gcc/attribs.cc:1219
0x115c284 ix86_get_function_versions_dispatcher(void*)
../../gcc/config/i386/i386-features.cc:2770
0x6ce48b get_function_version_dispatcher(tree_node*)
../../gcc/cp/call.cc:8836
0x6e7057 resolve_address_of_overloaded_function
../../gcc/cp/class.cc:8607
0x6cfa8d standard_conversion
../../gcc/cp/call.cc:1227
0x6d1d4d implicit_conversion_1
../../gcc/cp/call.cc:2031
0x6d1d4d implicit_conversion
../../gcc/cp/call.cc:2132
0x6d6b9c can_convert_arg_bad(tree_node*, tree_node*, tree_node*, int, int)
../../gcc/cp/call.cc:12625
0x893291 convert_for_assignment
../../gcc/cp/typeck.cc:9831
0x893acb convert_for_initialization(tree_node*, tree_node*, tree_node*, int,
impl_conv_rhs, tree_node*, int, int)
../../gcc/cp/typeck.cc:10062
0x899ffd digest_init_r
../../gcc/cp/typeck2.cc:1357
0x89b7e0 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/cp/typeck2.cc:1370
0x89b7e0 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/cp/typeck2.cc:842
0x74ad20 check_initializer
../../gcc/cp/decl.cc:7279
0x74c201 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.cc:8247
0x80ecdf cp_parser_init_declarator
../../gcc/cp/parser.cc:22823
0x7ecec2 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15286
0x7ee769 cp_parser_declaration_statement
../../gcc/cp/parser.cc:14367
0x7eed6b cp_parser_statement
../../gcc/cp/parser.cc:12452
0x7efcb4 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12856