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

            Bug ID: 112895
           Summary: ICE: error reporting routines re-entered. (in
                    check_tag cp/class.cc:1474) with
                    -fdiagnostics-format=sarif-stderr on simple C++ code
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: diagnostic, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fdiagnostics-format=sarif-stderr testcase.C

internal compiler error: error reporting routines re-entered.
{"$schema":
"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json";,
 "version": "2.1.0",
 "runs": [{"tool": {"driver": {"name": "GNU C++17",
                               "fullName": "GNU C++17 (GCC) version 14.0.0
20231207 (experimental) (x86_64-pc-linux-gnu)",
                               "version": "14.0.0 20231207 (experimental)",
                               "informationUri": "https://gcc.gnu.org/gcc-14/";,
                               "rules": [{"id": "-Wreturn-type",
                                          "helpUri":
"https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wreturn-type"}]}},
           "invocations": [{"executionSuccessful": true,
                            "toolExecutionNotifications": []}],
           "originalUriBaseIds": {"PWD": {"uri":
"file:///home/smatz/gcc-bug/569/"}},
           "artifacts": [{"location": {"uri": "testcase.C",
                                       "uriBaseId": "PWD"},
                          "contents": {"text": "inline namespace __cxx11
__attribute__((__abi_tag__))\n{\n  struct basic_string\n  {\n  };\n} //
namespace __cxx11\n\nbasic_string\nGetSMFFile ()\n{\n}\n"},
                          "sourceLanguage": "cplusplus"}],
           "results": []}]}
Internal compiler error:
0xee6ad7 check_tag
        /repo/gcc-trunk/gcc/cp/class.cc:1474
0xee6ad7 mark_or_check_attr_tags
        /repo/gcc-trunk/gcc/cp/class.cc:1517
0xee6ad7 mark_or_check_tags
        /repo/gcc-trunk/gcc/cp/class.cc:1542
0xee6c59 find_abi_tags_r
        /repo/gcc-trunk/gcc/cp/class.cc:1566
0x1b0b6b4 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /repo/gcc-trunk/gcc/tree.cc:11420
0x1b0ed95 walk_tree_without_duplicates_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*))
        /repo/gcc-trunk/gcc/tree.cc:11680
0xee7fd1 check_abi_tags
        /repo/gcc-trunk/gcc/cp/class.cc:1649
0xfdd424 write_mangled_name
        /repo/gcc-trunk/gcc/cp/mangle.cc:790
0xfe3450 mangle_decl_string
        /repo/gcc-trunk/gcc/cp/mangle.cc:4393
0xfe363a get_mangled_id
        /repo/gcc-trunk/gcc/cp/mangle.cc:4414
0xfe363a mangle_decl(tree_node*)
        /repo/gcc-trunk/gcc/cp/mangle.cc:4452
0x1ae611d decl_assembler_name(tree_node*)
        /repo/gcc-trunk/gcc/tree.cc:719
0x1886108 compiler_logical_location::get_internal_name_for_tree(tree_node*)
        /repo/gcc-trunk/gcc/tree-logical-location.cc:59
0x1886108 current_fndecl_logical_location::get_internal_name() const
        /repo/gcc-trunk/gcc/tree-logical-location.cc:140
0x2c983c0 sarif_builder::make_logical_location_object(logical_location const&)
const
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:1109
0x2c99ee1 sarif_builder::set_any_logical_locs_arr(json::object*,
logical_location const*)
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:757
0x2c99ee1 sarif_builder::set_any_logical_locs_arr(json::object*,
logical_location const*)
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:751
0x2c99ee1 sarif_builder::make_location_object(rich_location const&,
logical_location const*)
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:780
0x2c9a0be sarif_builder::make_locations_arr(diagnostic_info const&)
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:742
0x2c9bba5 sarif_builder::make_result_object(diagnostic_context*,
diagnostic_info const&, diagnostic_t)
        /repo/gcc-trunk/gcc/diagnostic-format-sarif.cc:604
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-6262-20231207003818-g3cbab07b08d-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-6262-20231207003818-g3cbab07b08d-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231207 (experimental) (GCC)

Reply via email to