[Bug c++/71465] New: ICE on invalid C++ code (with duplicate base) on x86_64-linux-gnu: in dfs_build_secondary_vptr_vtt_inits, at cp/class.c:9075
su at cs dot ucdavis.edu
gcc-bugzilla@gcc.gnu.org
Thu Jun 9 00:23:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71465
Bug ID: 71465
Summary: ICE on invalid C++ code (with duplicate base) on
x86_64-linux-gnu: in
dfs_build_secondary_vptr_vtt_inits, at cp/class.c:9075
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
The following code causes an ICE when compiled with the current gcc trunk on
x86_64-linux-gnu in both 32-bit and 64-bit modes.
This is a regression from 6.1.x.
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237196] (GCC)
$
$ g++-6.1 -c small.cpp
small.cpp:4:18: error: duplicate base type ‘C’ invalid
struct D : C, B, C {};
^
$
$ g++-trunk -c small.cpp
small.cpp:4:18: error: duplicate base type ‘C’ invalid
struct D : C, B, C {};
^
small.cpp:4:8: internal compiler error: in dfs_build_secondary_vptr_vtt_inits,
at cp/class.c:9075
struct D : C, B, C {};
^
0x74907e dfs_build_secondary_vptr_vtt_inits
../../gcc-source-trunk/gcc/cp/class.c:9075
0x80472e dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
../../gcc-source-trunk/gcc/cp/search.c:1798
0x804774 dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
../../gcc-source-trunk/gcc/cp/search.c:1810
0x804774 dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
../../gcc-source-trunk/gcc/cp/search.c:1810
0x807b88 dfs_walk_once(tree_node*, tree_node* (*)(tree_node*, void*),
tree_node* (*)(tree_node*, void*), void*)
../../gcc-source-trunk/gcc/cp/search.c:1895
0x7492cd build_vtt_inits
../../gcc-source-trunk/gcc/cp/class.c:9022
0x74d216 build_vtt
../../gcc-source-trunk/gcc/cp/class.c:8907
0x74d216 finish_struct_1(tree_node*)
../../gcc-source-trunk/gcc/cp/class.c:7070
0x74edb4 finish_struct(tree_node*, tree_node*)
../../gcc-source-trunk/gcc/cp/class.c:7265
0x78875c cp_parser_class_specifier_1
../../gcc-source-trunk/gcc/cp/parser.c:21368
0x78875c cp_parser_class_specifier
../../gcc-source-trunk/gcc/cp/parser.c:21596
0x78875c cp_parser_type_specifier
../../gcc-source-trunk/gcc/cp/parser.c:15836
0x79d223 cp_parser_decl_specifier_seq
../../gcc-source-trunk/gcc/cp/parser.c:12758
0x7aa711 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12299
0x7aab61 cp_parser_block_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12246
0x7b3f40 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12143
0x7b2a14 cp_parser_declaration_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:12022
0x7b2d48 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4324
0x7b2d48 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:37502
0x9162f2 c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$
-------------------------------------
struct A { virtual void foo () {} };
struct B : virtual A {};
struct C : virtual A {};
struct D : C, B, C {};
More information about the Gcc-bugs
mailing list