https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100643
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Ever confirmed|0 |1 Last reconfirmed| |2021-06-01 CC| |jason at gcc dot gnu.org --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- Slightly clean up test-case: $ cat pr100643.c int foo() { int foo(void) __attribute__((target("avx"))); int foo(void) __attribute__((target("default"))); return 123; } $ g++ pr100643.c -c pr100643.c:7:1: internal compiler error: in ix86_mangle_function_version_assembler_name, at config/i386/i386-features.c:2809 7 | } | ^ 0x8b6dba ix86_mangle_function_version_assembler_name /home/marxin/Programming/gcc/gcc/config/i386/i386-features.c:2809 0x8b6dba ix86_mangle_decl_assembler_name(tree_node*, tree_node*) /home/marxin/Programming/gcc/gcc/config/i386/i386-features.c:2839 0xa671bf get_mangled_id /home/marxin/Programming/gcc/gcc/cp/mangle.c:4041 0xa671bf mangle_decl(tree_node*) /home/marxin/Programming/gcc/gcc/cp/mangle.c:4078 0x147028c decl_assembler_name(tree_node*) /home/marxin/Programming/gcc/gcc/tree.c:711 0x14ca040 notice_global_symbol(tree_node*) /home/marxin/Programming/gcc/gcc/varasm.c:1801 0xd18798 cgraph_node::finalize_function(tree_node*, bool) /home/marxin/Programming/gcc/gcc/cgraphunit.c:453 0xb9241e expand_or_defer_fn(tree_node*) /home/marxin/Programming/gcc/gcc/cp/semantics.c:4681 0xb0b138 cp_parser_function_definition_after_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:30157 0xb0c59d cp_parser_function_definition_from_specifiers_and_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:30060 0xb0c59d cp_parser_init_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:21706 0xae711c cp_parser_simple_declaration /home/marxin/Programming/gcc/gcc/cp/parser.c:14487 0xb15be4 cp_parser_declaration /home/marxin/Programming/gcc/gcc/cp/parser.c:14184 0xb1675c cp_parser_toplevel_declaration /home/marxin/Programming/gcc/gcc/cp/parser.c:14213 0xb1675c cp_parser_translation_unit /home/marxin/Programming/gcc/gcc/cp/parser.c:4942 0xb1675c c_parse_file() /home/marxin/Programming/gcc/gcc/cp/parser.c:45508 0xc4b2d9 c_common_parse_file() /home/marxin/Programming/gcc/gcc/c-family/c-opts.c:1219 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Where we ICE because the top-level function definition has DECL_FUNCTION_VERSIONED (decl) set, but it does not contain "target" attribute. @Jason: Is it really a valid test-case?