https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117782

            Bug ID: 117782
           Summary: template ICE in write_unscoped_name while using
                    autofda bootstrap on aarch64
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kugan at gcc dot gnu.org
  Target Milestone: ---

Created attachment 59704
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59704&action=edit
testcase

(gdb) bt
#0  fancy_abort (file=0x3dd5b40 "../../gcc/gcc/cp/mangle.cc", line=1196,
function=0x3dd5df0 "write_unscoped_name") at ../../gcc/gcc/diagnostic.cc:1502
#1  0x00000000010e425c in write_unscoped_name (decl=0xfffff7f80280) at
../../gcc/gcc/cp/mangle.cc:1196
#2  0x00000000010e42a0 in write_unscoped_template_name (decl=0xfffff7f80280) at
../../gcc/gcc/cp/mangle.cc:1214
#3  0x00000000010e3fcc in write_name (decl=0xfffff60a1400,
ignore_local_scope=0) at ../../gcc/gcc/cp/mangle.cc:1121
#4  0x00000000010e2d18 in write_encoding (decl=0xfffff60a1400) at
../../gcc/gcc/cp/mangle.cc:938
#5  0x00000000010e2148 in write_mangled_name (decl=0xfffff60a1400,
top_level=true) at ../../gcc/gcc/cp/mangle.cc:820
#6  0x00000000010f7468 in mangle_decl_string (decl=0xfffff60a1400) at
../../gcc/gcc/cp/mangle.cc:4427
#7  0x00000000010f74e4 in get_mangled_id (decl=0xfffff60a1400) at
../../gcc/gcc/cp/mangle.cc:4448
#8  0x00000000010f7894 in mangle_decl (decl=0xfffff60a1400) at
../../gcc/gcc/cp/mangle.cc:4486
#9  0x00000000021c7e30 in decl_assembler_name (decl=0xfffff60a1400) at
../../gcc/gcc/tree.cc:725
#10 0x000000000357ee80 in autofdo::string_table::get_index_by_decl
(this=0x4d25e00, decl=0xfffff60a1400) at ../../gcc/gcc/auto-profile.cc:483
#11 0x000000000357efb8 in autofdo::string_table::get_index_by_decl
(this=0x4d25e00, decl=0xfffff60a1600) at ../../gcc/gcc/auto-profile.cc:492
#12 0x000000000358061c in
autofdo::autofdo_source_profile::get_function_instance_by_inline_stack
(this=0x4d8faa0, stack=...) at ../../gcc/gcc/auto-profile.cc:892
#13 0x00000000035803c4 in
autofdo::autofdo_source_profile::get_callsite_total_count (this=0x4d8faa0,
edge=0xfffff5d212b0) at ../../gcc/gcc/auto-profile.cc:838
#14 0x0000000003583040 in afdo_callsite_hot_enough_for_early_inline
(edge=0xfffff5d212b0) at ../../gcc/gcc/auto-profile.cc:1718
#15 0x0000000003753a80 in want_early_inline_function_p (e=0xfffff5d212b0) at
../../gcc/gcc/ipa-inline.cc:789
#16 0x000000000375b214 in early_inline_small_functions (node=0xfffff5d11ed0) at
../../gcc/gcc/ipa-inline.cc:3064
#17 0x000000000375b5ec in early_inliner (fun=0xfffff6070b40) at
../../gcc/gcc/ipa-inline.cc:3157
#18 0x000000000375b820 in (anonymous namespace)::pass_early_inline::execute
(this=0x4d361c0, fun=0xfffff6070b40) at ../../gcc/gcc/ipa-inline.cc:3232
#19 0x0000000001be5810 in execute_one_pass (pass=0x4d361c0) at
../../gcc/gcc/passes.cc:2654
#20 0x0000000001be5ca4 in execute_pass_list_1 (pass=0x4d361c0) at
../../gcc/gcc/passes.cc:2763
#21 0x0000000001be5d50 in execute_pass_list (fn=0xfffff6070b40, pass=0x4d360a0)
at ../../gcc/gcc/passes.cc:2774
#22 0x0000000001be3040 in do_per_function_toporder (callback=0x1be5d08
<execute_pass_list(function*, opt_pass*)>, data=0x4d360a0) at
../../gcc/gcc/passes.cc:1781
#23 0x0000000001be6bf8 in execute_ipa_pass_list (pass=0x4d36040) at
../../gcc/gcc/passes.cc:3113
#24 0x00000000015eca84 in ipa_passes () at ../../gcc/gcc/cgraphunit.cc:2214
#25 0x00000000015ecf50 in symbol_table::compile (this=0xfffff5c90000) at
../../gcc/gcc/cgraphunit.cc:2337
#26 0x00000000015ed6b4 in symbol_table::finalize_compilation_unit
(this=0xfffff5c90000) at ../../gcc/gcc/cgraphunit.cc:2589
#27 0x0000000001d85cd4 in compile_file () at ../../gcc/gcc/toplev.cc:478
#28 0x0000000001d8a144 in do_compile () at ../../gcc/gcc/toplev.cc:2209
#29 0x0000000001d8a6b0 in toplev::main (this=0xfffffffff460, argc=8,
argv=0xfffffffff5e8) at ../../gcc/gcc/toplev.cc:2369
#30 0x0000000003970f10 in main (argc=8, argv=0xfffffffff5e8) at
../../gcc/gcc/main.cc:39


#1  0x00000000010e425c in write_unscoped_name (decl=0xfffff7f80280) at
../../gcc/gcc/cp/mangle.cc:1196
1196          gcc_assert (context == global_namespace
(gdb) l
1191      else
1192        {
1193          /* If not, it should be either in the global namespace, or
directly
1194             in a local function scope.  A lambda can also be mangled in
the
1195             scope of a default argument.  */
1196          gcc_assert (context == global_namespace
1197                      || TREE_CODE (context) == PARM_DECL
1198                      || TREE_CODE (context) == FUNCTION_DECL);
1199
1200          write_unqualified_name (decl);
(gdb) p context
$1 = (tree) 0xfffff60450b8
(gdb) p debug_tree(context)
 <record_type 0xfffff60450b8 function asm_written cxx-odr-p type_1 type_5
type_6 QI
    size <integer_cst 0xfffff5c512f0 type <integer_type 0xfffff5d600a8
bitsizetype> constant 8>
    unit-size <integer_cst 0xfffff5c51308 type <integer_type 0xfffff5d60000
sizetype> constant 1>
    align:8 warn_if_not_align:0 symtab:-170393040 alias-set -1 canonical-type
0xfffff60450b8
    fields <field_decl 0xfffff5d45878 D.4462
        type <record_type 0xfffff6044a28 _Function_base asm_written cxx-odr-p
type_5 type_6 QI size <integer_cst 0xfffff5c512f0 8> unit-size <integer_cst
0xfffff5c51308 1>
            align:8 warn_if_not_align:0 symtab:-170393360 alias-set 7
canonical-type 0xfffff6044a28 fields <field_decl 0xfffff5d454e8 _M_manager>
context <translation_unit_decl 0xfffff5c800f0 test1.cpp>
            pointer_to_this <pointer_type 0xfffff6044f68> reference_to_this
<reference_type 0xfffff60494f8>>
        private ignored decl_6 QI test1.cpp:5:7 size <integer_cst
0xfffff5c512f0 8> unit-size <integer_cst 0xfffff5c51308 1>
        align:8 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 0
        offset <integer_cst 0xfffff5c51230 constant 0>
        bit-offset <integer_cst 0xfffff5c51278 constant 0> context <record_type
0xfffff60450b8 function>> context <translation_unit_decl 0xfffff5c800f0
test1.cpp>
    pointer_to_this <pointer_type 0xfffff60452b0> reference_to_this
<reference_type 0xfffff6049cd8>>
$2 = void
(gdb) 

(gdb) p debug_tree(decl)
 <template_decl 0xfffff7f80280 __ct 
    type <method_type 0xfffff60454a8
        type <void_type 0xfffff5d60f18 void asm_written type_6 VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0xfffff5d60f18
            pointer_to_this <pointer_type 0xfffff5d60fc0>>
        type_0 type_6 SI
        size <integer_cst 0xfffff5c51440 constant 32>
        unit-size <integer_cst 0xfffff5c51458 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0xfffff60454a8 method basetype <record_type 0xfffff60450b8 function>
        arg-types <tree_list 0xfffff60387f0 value <pointer_type 0xfffff60452b0>
            chain <tree_list 0xfffff60387c8 value <template_type_parm
0xfffff6045208 _Functor>
                chain <tree_list 0xfffff5ce0988 value <void_type 0xfffff5d60f18
void>>>>>
    ignored abstract decl_1 VOID test1.cpp:7:32
    align:1 warn_if_not_align:0 context <record_type 0xfffff60450b8 function>
chain <template_decl 0xfffff7f80480 __ct_base >>
$3 = void


command used:
 ./prev-gcc/cc1plus  -fauto-profile=cc1plus.fda -fno-PIE -c -g -O2 
-flto=jobserver  test1.cpp

Reply via email to