https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117350
--- Comment #5 from ak at gcc dot gnu.org --- Also the ICE had a truncated backtrace. Checking it in gdb gives the full one. The bad mangling happens while autofdo is reading the string table of the afdo file, and trying to generate the asm name of an arbitrary decl. #0 write_unscoped_name (decl=<template_decl 0x7f17c25d8980 __ct >) at ../../gcc/gcc/cp/mangle.cc:1197 #1 0x0000000000b23797 in write_unscoped_template_name (decl=<template_decl 0x7f17c25d8980 __ct >) at ../../gcc/gcc/cp/mangle.cc:1215 #2 write_name (decl=<function_decl 0x7f17c25e7f00 __ct >, ignore_local_scope=<optimized out>) at ../../gcc/gcc/cp/mangle.cc:1122 #3 0x0000000000b24a2a in write_encoding (decl=<function_decl 0x7f17c25e7f00 __ct >) at ../../gcc/gcc/cp/mangle.cc:939 #4 0x0000000000b24c0a in write_mangled_name (decl=decl@entry=<function_decl 0x7f17c25e7f00 __ct >, top_level=top_level@entry=true) at ../../gcc/gcc/cp/mangle.cc:821 #5 0x0000000000b2cba4 in mangle_decl_string (decl=decl@entry=<function_decl 0x7f17c25e7f00 __ct >) at ../../gcc/gcc/cp/mangle.cc:4428 #6 0x0000000000b2cda8 in get_mangled_id (decl=<function_decl 0x7f17c25e7f00 __ct >) at ../../gcc/gcc/cp/mangle.cc:4449 #7 mangle_decl (decl=<function_decl 0x7f17c25e7f00 __ct >) at ../../gcc/gcc/cp/mangle.cc:4487 #8 0x00000000016ad32b in decl_assembler_name (decl=<function_decl 0x7f17c25e7f00 __ct >) at ../../gcc/gcc/tree.cc:728 #9 0x00000000024e1007 in autofdo::string_table::get_index_by_decl (this=0x34c0b9c0, decl=<optimized out>)