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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-reduction             |
      Known to work|                            |9.2.0
            Summary|internal compiler error: in |[10 Regression] internal
                   |hashtab_chk_error, at       |compiler error: in
                   |hash-table.c:137            |hashtab_chk_error, at
                   |                            |hash-table.c:137
      Known to fail|                            |10.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
creduce yielded the following, which compiles with gcc 9 and -fconcepts.

ICEs with gcc 10 and -std=gnu++2a

template <int a> struct c {
  static constexpr int d = a;
  typedef c e;
};
template <typename> struct f;
template <typename b> using g = typename f<b>::e;
struct b;
template <typename b> struct f { using e = b; };
template <typename ai> struct m { typedef g<ai> aj; };
template <typename b> class n { typedef typename m<b>::aj e; };
template <typename b> using an = typename n<b>::e;
template <typename> constexpr bool ao = c<true>::d;
template <typename> constexpr bool i = c<1>::d;
template <typename> concept bb = i<b>;
using cc = __int128;
template <typename> concept cd = bb<cc>;
template <typename bt> concept ce = requires { requires cd<bt>; };
template <typename bt> concept h = ce<bt>;
template <typename bt> concept l = h<bt>;
template <typename> concept cl = ao<b>;
template <typename b> concept cp = requires(b j) {
  requires h<an<decltype(j.begin())>>;
};
struct o {
  template <cl b> requires cp<b> auto operator()(b) {}
};
template <typename b> using cm = decltype(o{}(b()));
template <typename bt> concept ct = l<bt>;
template <typename da> concept dd = ct<cm<da>>;
template <typename da> concept de = dd<da>;
struct {
  template <de da, typename b> void operator()(da, b);
} di;
class p {
  void begin();
};
template <typename> using df = p;
template <int> void q() {
  df<int> k;
  int d;
  di(k, d);
}


hash table checking failed: equal operator returns true for a pair of values
with a different hash value
constrained.cc: In instantiation of ‘void<unnamed struct>::operator()(da, b)
[with da = p; b = int]’:
constrained.cc:41:10:   required from here
constrained.cc:17:57: internal compiler error: in hashtab_chk_error, at
hash-table.c:137
   17 | template <typename bt> concept ce = requires { requires cd<bt>; };
      |                                                ~~~~~~~~~^~~~~~
0x8ec130 hashtab_chk_error()
        /home/jwakely/src/gcc/gcc/gcc/hash-table.c:137
0x94efd3 hash_table<sat_hasher, false, xcallocator>::verify(sat_entry* const&,
unsigned int)
        /home/jwakely/src/gcc/gcc/gcc/hash-table.h:1033
0x94f5cf hash_table<sat_hasher, false,
xcallocator>::find_slot_with_hash(sat_entry* const&, unsigned int,
insert_option)
        /home/jwakely/src/gcc/gcc/gcc/hash-table.h:968
0x94b9b3 hash_table<sat_hasher, false, xcallocator>::find_slot(sat_entry*
const&, insert_option)
        /home/jwakely/src/gcc/gcc/gcc/hash-table.h:435
0x94b9b3 save_satisfaction
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2304
0x94c042 satisfaction_cache::save(tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2338
0x94c042 satisfy_atom
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2552
0x94c042 satisfy_constraint_r
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2579
0x94cb38 satisfy_constraint
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2599
0x94ce27 tsubst_nested_requirement
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2006
0x94ce27 tsubst_requirement
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2027
0x94ce27 tsubst_requirement_body
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2043
0x94ce27 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2159
0xa8674a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:20336
0xa794c7 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:18597
0x94bdaa satisfy_atom
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2523
0x94bdaa satisfy_constraint_r
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2579
0x94cb38 satisfy_constraint
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2599
0x94e627 satisfy_declaration_constraints
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2698
0x94e627 constraint_satisfaction_value
        /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2733
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