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

            Bug ID: 85976
           Summary: ICE in cp_tree_equal when building Blitz. May be
                    nested templates.
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matthew.hambley at metoffice dot gov.uk
  Target Milestone: ---

When compiling https://github.com/blitzpp/blitz v1.0.1 an ICE is generated.
This does not happen with GCC 6.4.0 or 7.1.0. Processed source file attached.

g++ -v -save-temps -DHAVE_CONFIG_H   -I../../blitz-1.0.1/testsuite
-I../../blitz-1.0.1 -I..  -I.../gcc/8.1.0/include -g -DBZ_DEBUG -DBZ_DEBUG  -MT
expression-slicing.o -MD -MP -MF .deps/expression-slicing.Tpo -c -o
expression-slicing.o ../../blitz-1.0.1/testsuite/expression-slicing.cpp
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8.1.0/configure --prefix=.../gcc/8.1.0
--disable-multilib
Thread model: posix
gcc version 8.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-D' 'HAVE_CONFIG_H' '-I'
'../../blitz-1.0.1/testsuite' '-I' '../../blitz-1.0.1' '-I' '..' '-I'
'.../gcc/8.1.0/include' '-g' '-D' 'BZ_DEBUG' '-D' 'BZ_DEBUG' '-MT'
'expression-slicing.o' '-MD' '-MP' '-MF' '.deps/expression-slicing.Tpo' '-c'
'-o' 'expression-slicing.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 .../gcc/8.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.1.0/cc1plus -E -quiet
-v -I ../../blitz-1.0.1/testsuite -I ../../blitz-1.0.1 -I .. -I
.../gcc/8.1.0/include -iprefix
.../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/ -MD
expression-slicing.d -MF .deps/expression-slicing.Tpo -MP -MT
expression-slicing.o -D_GNU_SOURCE -D HAVE_CONFIG_H -D BZ_DEBUG -D BZ_DEBUG
../../blitz-1.0.1/testsuite/expression-slicing.cpp -mtune=generic -march=x86-64
-g -fworking-directory -fpch-preprocess -o expression-slicing.ii
ignoring nonexistent directory
".../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0"
ignoring duplicate directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0/x86_64-pc-linux-gnu"
ignoring duplicate directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0/backward"
ignoring duplicate directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/include"
ignoring duplicate directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/include-fixed"
ignoring nonexistent directory
".../gcc/8.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory ".../gcc/8.1.0/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 ../../blitz-1.0.1/testsuite
 ../../blitz-1.0.1
 ..

.../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0

.../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0/x86_64-pc-linux-gnu

.../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../include/c++/8.1.0/backward
 .../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/include
 .../gcc/8.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.0/include-fixed
 /usr/local/include
 .../gcc/8.1.0/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-D' 'HAVE_CONFIG_H' '-I'
'../../blitz-1.0.1/testsuite' '-I' '../../blitz-1.0.1' '-I' '..' '-I'
'.../gcc/8.1.0/include' '-g' '-D' 'BZ_DEBUG' '-D' 'BZ_DEBUG' '-MT'
'expression-slicing.o' '-MD' '-MP' '-MF' '.deps/expression-slicing.Tpo' '-c'
'-o' 'expression-slicing.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 .../gcc/8.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.1.0/cc1plus
-fpreprocessed expression-slicing.ii -quiet -dumpbase expression-slicing.cpp
-mtune=generic -march=x86-64 -auxbase-strip expression-slicing.o -g -version -o
expression-slicing.s
GNU C++14 (GCC) version 8.1.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 8.1.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++14 (GCC) version 8.1.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 8.1.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 70ca2263e1163415e5052b440bbed5d9
In file included from ../../blitz-1.0.1/blitz/array/stencil-et.h:398,
                 from ../../blitz-1.0.1/testsuite/expression-slicing.cpp:3:
../../blitz-1.0.1/blitz/array/stencil-classes.cc:227:73: internal compiler
error: in cp_tree_equal, at cp/tree.c:3896
                                                              rank_> >::type i)
const
                                                                     ^

0x5ce766 cp_tree_equal(tree_node*, tree_node*)
        ../../gcc-8.1.0/gcc/cp/tree.c:3896
0x6e6179 template_args_equal(tree_node*, tree_node*, bool)
        ../../gcc-8.1.0/gcc/cp/pt.c:8688
0x6e5ff9 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**,
bool)
        ../../gcc-8.1.0/gcc/cp/pt.c:8717
0x73e8af structural_comptypes
        ../../gcc-8.1.0/gcc/cp/typeck.c:1337
0x6e62ec template_args_equal(tree_node*, tree_node*, bool)
        ../../gcc-8.1.0/gcc/cp/pt.c:8669
0x6e5ff9 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**,
bool)
        ../../gcc-8.1.0/gcc/cp/pt.c:8717
0x6ebcf9 spec_hasher::equal(spec_entry*, spec_entry*)
        ../../gcc-8.1.0/gcc/cp/pt.c:1668
0x71301d hash_table<spec_hasher, xcallocator>::find_with_hash(spec_entry*
const&, unsigned int)
        ../../gcc-8.1.0/gcc/hash-table.h:850
0x6fb2c4 lookup_template_class_1
        ../../gcc-8.1.0/gcc/cp/pt.c:9331
0x6fb2c4 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc-8.1.0/gcc/cp/pt.c:9650
0x71eced finish_template_type(tree_node*, tree_node*, int)
        ../../gcc-8.1.0/gcc/cp/semantics.c:3228
0x6c3b14 cp_parser_template_id
        ../../gcc-8.1.0/gcc/cp/parser.c:15861
0x6c3c2e cp_parser_class_name
        ../../gcc-8.1.0/gcc/cp/parser.c:22396
0x6cf507 cp_parser_qualifying_entity
        ../../gcc-8.1.0/gcc/cp/parser.c:6570
0x6cf507 cp_parser_nested_name_specifier_opt
        ../../gcc-8.1.0/gcc/cp/parser.c:6256
0x6cfb41 cp_parser_nested_name_specifier
        ../../gcc-8.1.0/gcc/cp/parser.c:6496
0x6cfc4e cp_parser_elaborated_type_specifier
        ../../gcc-8.1.0/gcc/cp/parser.c:17667
0x6cb579 cp_parser_type_specifier
        ../../gcc-8.1.0/gcc/cp/parser.c:16811
0x6d7755 cp_parser_decl_specifier_seq
        ../../gcc-8.1.0/gcc/cp/parser.c:13623
0x6d7dbb cp_parser_parameter_declaration
        ../../gcc-8.1.0/gcc/cp/parser.c:21512
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.

Reply via email to