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

            Bug ID: 88317
           Summary: ICE: Segmentation fault (in split_reg ->
                    bitmap_set_bit -> bitmap_list_link_element)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, ra
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-unknown-linux-gnu

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

gcc-9.0.0-alpha20181202 snapshot (r266729) ICEs when compiling the attached
testcase w/ -O1 -fschedule-insns -fselective-scheduling -ftrapv
-funroll-all-loops -fno-tree-ccp -fno-tree-dce -fno-tree-dominator-opts
-fno-tree-fre -fno-tree-sra:

% x86_64-unknown-linux-gnu-gcc-9.0.0-alpha20181202 -O1 -fschedule-insns
-fselective-scheduling -ftrapv -funroll-all-loops -fno-tree-ccp -fno-tree-dce
-fno-tree-dominator-opts -fno-tree-fre -fno-tree-sra -w -c ovoyxfol.c -v
Using built-in specs.
COLLECT_GCC=x86_64-unknown-linux-gnu-gcc-9.0.0-alpha20181202
Target: x86_64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/configure
--host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-unknown-linux-gnu/gcc-bin/9.0.0-alpha20181202
--includedir=/usr/lib/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/include
--datadir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/9.0.0-alpha20181202
--mandir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/man
--infodir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/include/g++-v9
--with-python-dir=/share/gcc-data/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=yes --disable-esp
--enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --with-multilib-list=m64 --disable-altivec
--disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libmpx --disable-systemtap
--disable-vtable-verify --disable-libvtv --disable-libquadmath --enable-lto
--with-isl --disable-isl-version-check --disable-libsanitizer
--enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 9.0.0-alpha20181202 20181202 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-O1' '-fschedule-insns' '-fselective-scheduling' '-ftrapv'
'-funroll-all-loops' '-fno-tree-ccp' '-fno-tree-dce' '-fno-tree-dominator-opts'
'-fno-tree-fre' '-fno-tree-sra' '-w' '-c' '-v' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/cc1 -quiet -v
ovoyxfol.c -quiet -dumpbase ovoyxfol.c -mtune=generic -march=x86-64 -auxbase
ovoyxfol -O1 -w -version -fschedule-insns -fselective-scheduling -ftrapv
-funroll-all-loops -fno-tree-ccp -fno-tree-dce -fno-tree-dominator-opts
-fno-tree-fre -fno-tree-sra -o /tmp/ccZdGkhr.s
GNU C17 (GCC) version 9.0.0-alpha20181202 20181202 (experimental)
(x86_64-unknown-linux-gnu)
        compiled by GNU C version 9.0.0-alpha20181202 20181202 (experimental),
GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version
isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/include
 /usr/lib/gcc/x86_64-unknown-linux-gnu/9.0.0-alpha20181202/include-fixed
 /usr/include
End of search list.
GNU C17 (GCC) version 9.0.0-alpha20181202 20181202 (experimental)
(x86_64-unknown-linux-gnu)
        compiled by GNU C version 9.0.0-alpha20181202 20181202 (experimental),
GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version
isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: a92a885da50bf198a0c1fc913bab14ec
during RTL pass: reload
ovoyxfol.c: In function 'vb':
ovoyxfol.c:661:1: internal compiler error: Segmentation fault
  661 | }
      | ^
0xd0821f crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/toplev.c:326
0x88ea20 bitmap_list_link_element
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/bitmap.c:212
0x88ea20 bitmap_set_bit(bitmap_head*, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/bitmap.c:948
0xb8d824 split_reg
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/lra-constraints.c:5656
0xb9768f spill_hard_reg_in_range(int, reg_class, rtx_insn*, rtx_insn*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/lra-constraints.c:5764
0xb89c9f lra_split_hard_reg_for()
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/lra-assigns.c:1765
0xb84405 lra(_IO_FILE*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/lra.c:2533
0xb3b929 do_reload
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/ira.c:5469
0xb3b929 execute
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20181202/work/gcc-9-20181202/gcc/ira.c:5653

==17984== Invalid read of size 4
==17984==    at 0x88EA20: bitmap_list_link_element (bitmap.c:212)
==17984==    by 0x88EA20: bitmap_set_bit(bitmap_head*, int) (bitmap.c:948)
==17984==    by 0xB8D824: split_reg(bool, int, rtx_insn*, rtx_def*, rtx_insn*)
(lra-constraints.c:5656)
==17984==    by 0xB9768F: spill_hard_reg_in_range(int, reg_class, rtx_insn*,
rtx_insn*) (lra-constraints.c:5764)
==17984==    by 0xB89C9F: lra_split_hard_reg_for() (lra-assigns.c:1765)
==17984==    by 0xB84405: lra(_IO_FILE*) (lra.c:2533)
==17984==    by 0xB3B929: do_reload (ira.c:5469)
==17984==    by 0xB3B929: (anonymous
namespace)::pass_reload::execute(function*) (ira.c:5653)
==17984==    by 0xC27FC9: execute_one_pass(opt_pass*) (passes.c:2483)
==17984==    by 0xC286FF: execute_pass_list_1(opt_pass*) (passes.c:2569)
==17984==    by 0xC28711: execute_pass_list_1(opt_pass*) (passes.c:2570)
==17984==    by 0xC28738: execute_pass_list(function*, opt_pass*)
(passes.c:2580)
==17984==    by 0x90A2AF: cgraph_node::expand() (cgraphunit.c:2196)
==17984==    by 0x90B2A3: expand_all_functions (cgraphunit.c:2334)
==17984==    by 0x90B2A3: symbol_table::compile() [clone .part.0]
(cgraphunit.c:2685)
==17984==  Address 0x8000000010 is not stack'd, malloc'd or (recently) free'd

I've been chasing this group of failures down for about a year. The attached
testcase is unsuitable for the testsuite, yet it's the smallest one I could
come up with so far. The failure manifests itself in half dozen different ICEs
and RA hangs which can be encountered by making some random changes in the
testcase.

Reply via email to