https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109531
Bug ID: 109531
Summary: Checking ICE with hash table checking failed: equal
operator returns true for a pair of values with a
different hash value
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Created attachment 54872
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54872&action=edit
ArithmeticSubtermGeneralization.ii.orig.xz
Hit this with vampire-4.7:
```
$ /usr/bin/x86_64-pc-linux-gnu-g++ -DCHECK_LEAKS=0 -DVDEBUG=0 -DVZ3=1
-I/var/tmp/portage/sci-mathematics/vampire-4.7-r1/work/vampire-2d02e4655e1b08d1ca9ee7c0aade40f59f046460
-O2 -march=znver3 -pipe -U_GLIBCXX_ASSERTIONS -U_FORTIFY_SOURCE
-fno-strict-aliasing -std=c++14 -fdiagnostics-color=always -Wall -c
/var/tmp/portage/sci-mathematics/vampire-4.7-r1/work/vampire-2d02e4655e1b08d1ca9ee7c0aade40f59f046460/Inferences/ArithmeticSubtermGeneralization.cpp
hash table checking failed: equal operator returns true for a pair of values
with a different hash value
[... warning output ...]
/var/tmp/portage/sci-mathematics/vampire-4.7-r1/work/vampire-2d02e4655e1b08d1ca9ee7c0aade40f59f046460/Lib/Metaiterators.hpp:1787:19:
internal compiler error: in hashtab_chk_error, at hash-table.cc:137
1787 | Container<Elem> collect()
| ^~~~~~~
0x18f8915 hashtab_chk_error()
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/hash-table.cc:137
0x67cd7a hash_table<ctp_hasher, false, xcallocator>::verify(tree_node* const&,
unsigned int)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/hash-table.h:1118
0x67cd7a hash_table<ctp_hasher, false,
xcallocator>::find_slot_with_hash(tree_node* const&, unsigned int,
insert_option)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/hash-table.h:1046
0x67cd7a hash_table<ctp_hasher, false, xcallocator>::find_slot(tree_node*
const&, insert_option)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/hash-table.h:435
0x67cd7a canonical_type_parameter(tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:4536
0x1d69d7f tsubst(tree_node*, tree_node*, int, tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:16298
0x1e7d600 tsubst_function_type
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:15649
0x1d689e9 tsubst(tree_node*, tree_node*, int, tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:16468
0x1e7a865 tsubst_function_decl
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:14419
0x202b236 tsubst_template_decl
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:14730
0x1e5be82 tsubst_decl
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:14892
0x1e72315 instantiate_class_template(tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:12338
0x1aa8568 complete_type(tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/typeck.cc:138
0x1aa8402 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/typeck.cc:151
0x1cab4b2 require_complete_type(tree_node*, int)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/typeck.cc:94
0x1ca483e build_cxx_call(tree_node*, int, tree_node**, int, tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/call.cc:10981
0x84ef64 build_over_call
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/call.cc:10432
0x1d91d09 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/call.cc:11703
0x1df5802 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:21314
0x1e1a540 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/usr/src/debug/sys-devel/gcc-13.0.1_pre20230416/gcc-13-20230416/gcc/cp/pt.cc:19888
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```
'g++-13 -O2 -Wall -c ArithmeticSubtermGeneralization.ii' is enough to
reproduce.
Reduction in progress.