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

            Bug ID: 101853
           Summary: [12 Regression] g++.dg/modules/xtreme-header-5_b.C ICE
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hp at gcc dot gnu.org
                CC: nathan at acm dot org, redi at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: cris-elf

With c8b024fa4b76bfd914e96dd3cecfbb6ee8e91316 (r12-2773)
the g++.dg/modules/xtreme-header-5_b.C test started to fail with an ICE for
cris-elf:

Running /X/gcc/testsuite/g++.dg/modules/modules.exp ...
...
FAIL: g++.dg/modules/xtreme-header-5_b.C -std=c++2a (internal compiler error)
FAIL: g++.dg/modules/xtreme-header-5_b.C -std=c++2a (test for excess errors)
...
with the following in g++.log (edited for brevity)

spawn -ignore SIGHUP /X/gccobj/gcc/testsuite/g++/../../xg++
-B/X/gccobj/gcc/testsuite/g++/../../
/X/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-5_b.C
-fdiagnostics-plain-output -nostdinc++
-I/X/gccobj/cris-elf/libstdc++-v3/include/cris-elf
-I/X/gccobj/cris-elf/libstdc++-v3/include -I/X/gcc/libstdc++-v3/libsupc++
-I/X/gcc/libstdc++-v3/include/backward -I/X/gcc/libstdc++-v3/testsuite/util
-fmessage-length=0 -std=c++2a -pedantic-errors -Wno-long-long -fmodules-ts
-fno-module-lazy -S -isystem /X/gccobj/cris-elf/./newlib/targ-include -isystem
/X/gcc/newlib/libc/include -o xtreme-header-5_b.s
/X/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-5_b.C:4:30: internal compiler
error: in add_mergeable_specialization, at cp/pt.c:30073
0x883218 add_mergeable_specialization(bool, bool, spec_entry*, tree_node*,
unsigned int)
        /X/gcc/gcc/cp/pt.c:30073
0x7dc4f7 trees_in::decl_value()
        /X/gcc/gcc/cp/module.cc:8081
0x7dd864 trees_in::tree_node(bool)
        /X/gcc/gcc/cp/module.cc:9161
0x7e5f7b module_state::read_cluster(unsigned int)
        /X/gcc/gcc/cp/module.cc:14819
0x7e633d module_state::load_section(unsigned int, binding_slot*)
        /X/gcc/gcc/cp/module.cc:18090
0x7e7646 module_state::read_language(bool)
        /X/gcc/gcc/cp/module.cc:18019
0x7e7864 direct_import
        /X/gcc/gcc/cp/module.cc:18885
0x8603b8 cp_parser_translation_unit
        /X/gcc/gcc/cp/parser.c:4925
0x8603b8 c_parse_file()
        /X/gcc/gcc/cp/parser.c:46181
0x9da2a1 c_common_parse_file()
        /X/gcc/gcc/c-family/c-opts.c:1223
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.
compiler exited with status 1

I don't see this for other targets on gcc-testresults@ (unless you count
i586-unknown-freebsd11.4 /
https://gcc.gnu.org/pipermail/gcc-testresults/2021-August/712406.html where
about all modules test fail with ICE). Also, it looks like -save-temps doesn't
help here, so please instruct on how to help me help you with the equivalent
information.

It's unlikely that r12-2773 is the cause rather than exposing the bug, being a
libstdc++ commit. Looking at the code cp/pt.c:30073, where there's a gcc_assert
on an expected empty hash-slot IIUC, makes me think this something like hashing
on uninitialized data or a plain bad hash).

Reply via email to