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

            Bug ID: 97918
           Summary: ICE near htab_hash_string when LTO, -O & -g
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jengelh at inai dot de
  Target Milestone: ---

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

An ICE is observed on firefox-83 with gcc-10.2.1, persisting in git master du
jour too (d3f293348768667c07770e433ff00af51fee73a2).
I distilled the original cpp output from 298k to about 80k lines so far (x3.ii
attachment). The last two functions in that file ultimately trigger it all.
Perhaps the template parameter packs are causing this…


Taking away any one of -flto, -O or -g makes the compile succeed.

» ./xg++ -B $PWD -std=gnu++17 -flto -O -g -c x3.ii
/home/jengelh/x3.ii: At global scope:
/home/jengelh/x3.ii:80113:1: internal compiler error: Segmentation fault
80113 | }
      | ^
0x103917f crash_signal
        ../.././gcc/toplev.c:330
0x7f09bf684d1f ???
       
/usr/src/debug/glibc-2.32-2.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x1c09464 htab_hash_string
        ../.././libiberty/hashtab.c:838
0xc71874 external_ref_hasher::hash(external_ref const*)
        ../.././gcc/dwarf2out.c:8963
0xc71874 hash_table<external_ref_hasher, false,
xcallocator>::find_slot(external_ref* const&, insert_option)
        ../.././gcc/hash-table.h:435
0xc71874 lookup_external_ref
        ../.././gcc/dwarf2out.c:8991
0xc71943 optimize_external_refs_1
        ../.././gcc/dwarf2out.c:9029
0xc7190f optimize_external_refs_1
        ../.././gcc/dwarf2out.c:9033
0xc71a08 optimize_external_refs
        ../.././gcc/dwarf2out.c:9082
0xc7aae9 output_comp_unit
        ../.././gcc/dwarf2out.c:11101
0xca95a3 dwarf2out_early_finish
        ../.././gcc/dwarf2out.c:32299
0xc066af symbol_table::finalize_compilation_unit()
        ../.././gcc/cgraphunit.c:2537
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.

» ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: x86_64-pc-linux-gnu
Configured with: ./configure --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201119 (experimental) (GCC)

Reply via email to