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

            Bug ID: 105227
           Summary: [12 Regression] ICE in type_in_anonymous_namespace_p,
                    at ipa-utils.h:233
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

This started between 20211114 and 20211121,
with file g++.dg/ext/attr-alias-2.C at -Ofast :


$ g++-12-20211114 -c attr-alias-2.C -fPIC -flto -Ofast
$ g++-12-20220410 -c attr-alias-2.C -fPIC -flto -O3
$
$ g++-12-20220410 -c attr-alias-2.C -fPIC -flto -Ofast
during IPA pass: visibility
attr-alias-2.C:37:1: internal compiler error: Segmentation fault
   37 | }
      | ^
0xda8c2f crash_signal
        ../../gcc/toplev.cc:322
0xb58561 type_in_anonymous_namespace_p(tree_node const*)
        ../../gcc/ipa-utils.h:233
0xb58561 maybe_record_node
        ../../gcc/ipa-devirt.cc:2427
0xb5a918 possible_polymorphic_call_targets(tree_node*, long,
ipa_polymorphic_call_context, bool*, void**, bool)
        ../../gcc/ipa-devirt.cc:3241
0xbd28b9 possible_polymorphic_call_targets(cgraph_edge*, bool*, void**, bool)
        ../../gcc/ipa-utils.h:131
0xbd28b9 walk_polymorphic_call_targets
        ../../gcc/ipa.cc:183
0xbd28b9 symbol_table::remove_unreachable_nodes(_IO_FILE*)
        ../../gcc/ipa.cc:431
0xccedbd execute_todo
        ../../gcc/passes.cc:2153

---

$ g++-12-20220410 -c attr-alias-2.C -fPIC -flto -Ofast   # test version
during IPA pass: visibility
attr-alias-2.C:37:1: internal compiler error: tree check: expected class
'type', have 'declaration' (translation_unit_decl) in type_with_linkage_p, at
ipa-utils.h:198
   37 | }
      | ^
0x6c96a5 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.cc:8829
0xe1a61a tree_class_check(tree_node const*, tree_code_class, char const*, int,
char const*)
        ../../gcc/tree.h:3836
0xe1a61a type_with_linkage_p(tree_node const*)
        ../../gcc/ipa-utils.h:198
0xe1a61a type_in_anonymous_namespace_p(tree_node const*)
        ../../gcc/ipa-utils.h:229
0xe14011 maybe_record_node
        ../../gcc/ipa-devirt.cc:2427
0xe16221 possible_polymorphic_call_targets(tree_node*, long,
ipa_polymorphic_call_context, bool*, void**, bool)
        ../../gcc/ipa-devirt.cc:3241
0xea0837 possible_polymorphic_call_targets(cgraph_edge*, bool*, void**, bool)
        ../../gcc/ipa-utils.h:131
0xea0837 walk_polymorphic_call_targets
        ../../gcc/ipa.cc:183
0xea0837 symbol_table::remove_unreachable_nodes(_IO_FILE*)
        ../../gcc/ipa.cc:431
0xfd533d execute_todo
        ../../gcc/passes.cc:2153

Reply via email to