https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121981
Bug ID: 121981 Summary: internal compiler error: in hash, at cp/constraint.cc:1999 Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: ice-checking Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Created attachment 62405 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62405&action=edit preprocessed source compressed with xz I see an ICE on trunk for the attached code, compiled with -std=c++23. I don't think it's a regression, because I see the same ICE with old trunk builds, so I think it's just suppressed on release builds because they don't have checking enabled. $ ~/gcc/16/bin/g++ -std=c++23 mp.ii In file included from /opt/compiler-explorer/libs/mp-units/trunk/src/systems/include/mp-units/systems/si/units.h:27, from /opt/compiler-explorer/libs/mp-units/trunk/src/systems/include/mp-units/systems/si/chrono.h:30, from /opt/compiler-explorer/libs/mp-units/trunk/src/systems/include/mp-units/systems/si.h:27, from /app/example.cpp:1: /opt/compiler-explorer/libs/mp-units/trunk/src/core/include/mp-units/framework/construction_helpers.h: In substitution of 'template<auto [requires mp_units::Reference<<placeholder>, >] R, auto [requires mp_units::PointOriginFor<<placeholder>, mp_units::get_quantity_spec(R)>] PO, class Rep> requires RepresentationOf<Rep, mp_units::get_quantity_spec(R)> class mp_units::quantity_point [with auto [requires mp_units::Reference<<placeholder>, >] R = mp_units::si::milli_<mp_units::si::kelvin>(); auto [requires mp_units::PointOriginFor<<placeholder>, mp_units::get_quantity_spec(R)>] PO = mp_units::si::absolute_zero(); Rep = int]': required by substitution of 'template<class FwdRep, class Rep> requires RepresentationOf<Rep, mp_units::get_quantity_spec({})> constexpr mp_units::quantity_point<mp_units::si::milli_<mp_units::si::kelvin>(), mp_units::si::absolute_zero(), Rep> mp_units::point_<mp_units::si::milli_<mp_units::si::kelvin> >::operator()(FwdRep&&) const [with FwdRep = int; Rep = int]' /opt/compiler-explorer/libs/mp-units/trunk/src/core/include/mp-units/framework/construction_helpers.h:53:3: required from here /opt/compiler-explorer/libs/mp-units/trunk/src/systems/include/mp-units/systems/si/units.h:67:97: /opt/compiler-explorer/libs/mp-units/trunk/src/core/include/mp-units/framework/construction_helpers.h:53:3: internal compiler error: in hash, at cp/constraint.cc:1999 0x24a490d internal_error(char const*, ...) /home/jwakely/src/gcc/gcc/gcc/diagnostic-global-context.cc:786 0x72063f fancy_abort(char const*, int, char const*) /home/jwakely/src/gcc/gcc/gcc/diagnostics/context.cc:1787 0x7a56d2 sat_hasher::hash(sat_entry*) /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:1999 0x7a02df hash_table<sat_hasher, false, xcallocator>::find_slot(sat_entry* const&, insert_option) /home/jwakely/src/gcc/gcc/gcc/hash-table.h:435 0x7a02df satisfaction_cache::satisfaction_cache(tree_node*, tree_node*, sat_info) /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2096 0x7a3c2b satisfy_atom /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2435 0x7a3c2b satisfy_constraint_r /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2544 0x7a3d80 satisfy_conjunction /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2239 0x7a3d80 satisfy_constraint_r /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2540 0x7a3d80 satisfy_conjunction /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2239 0x7a3d80 satisfy_constraint_r /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2540 0x7a3d80 satisfy_conjunction /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2239 0x7a3d80 satisfy_constraint_r /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2540 0x7a38df satisfy_disjunction /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2297 0x7a38df satisfy_constraint_r /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2542 0x7a4791 satisfy_normalized_constraints /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2569 0x7a153c satisfy_declaration_constraints /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2791 0x7a153c constraint_satisfaction_value /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2812 0x7a4813 constraints_satisfied_p(tree_node*, tree_node*) /home/jwakely/src/gcc/gcc/gcc/cp/constraint.cc:2849 0x986a9c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int) /home/jwakely/src/gcc/gcc/gcc/cp/pt.cc:10327 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.