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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acoplan at gcc dot gnu.org

--- Comment #8 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Hi!

This ICE (or similar) is breaking the debian build on aarch64 (specifically for
the polymake package): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974058

I reduced to the following (invalid) testcase which hits the ICE on trunk
(reproduced on both x86 and aarch64):

constexpr int value = 1;
struct is_derived_from_instance_of;
template <bool, typename> struct enable_if;
template <bool _Cond, typename _Tp = void>
using enable_if_t = typename enable_if<_Cond, _Tp>::type;
template <typename> using is_generic_vector = is_derived_from_instance_of;
template <typename E> class matrix_methods {
  template <typename> using is_generic_matrix = is_derived_from_instance_of;
  template <typename, typename, typename, typename> struct block_matrix {
    template <typename Left, typename Right, typename Rowwise>
    block_matrix<Left, Right, Rowwise,
                 enable_if_t<value && is_generic_matrix<E>::value>>
        block_matrix<Left, Right, Rowwise,
                     enable_if_t<value && is_generic_vector<E>::value>>

This ICEs with:

$ aarch64-elf-gcc -c test.cc
test.cc:14:70: internal compiler error: canonical types differ for identical
types 'enable_if<(value && matrix_methods<E>::is_generic_matrix<E>::value),
void>' and 'enable_if<(value && is_generic_vector<E>::value), void>'
   14 |                      enable_if_t<value && is_generic_vector<E>::value>>
      |                                                                      ^~
0x98d86a comptypes(tree_node*, tree_node*, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1538
0x98eb82 same_type_ignoring_top_level_qualifiers_p(tree_node*, tree_node*)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1574
0x98cba4 structural_comptypes
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1423
0x98d6bd comptypes(tree_node*, tree_node*, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1556
0x8b04bc template_args_equal(tree_node*, tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:9175
0x8afea7 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**,
bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:9222
0x8b0283 template_args_equal(tree_node*, tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:9146
0x8afea7 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**,
bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:9222
0x8bd1a3 spec_hasher::equal(spec_entry*, spec_entry*)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:1716
0x9263e3 hash_table<spec_hasher, false,
xcallocator>::find_with_hash(spec_entry* const&, unsigned int)
        /home/alecop01/toolchain/src/gcc/gcc/hash-table.h:923
0x8f32d8 lookup_template_class_1
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:9830
0x8f32d8 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:10186
0x941d2f finish_template_type(tree_node*, tree_node*, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/semantics.c:3442
0x882bad cp_parser_template_id
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:16967
0x8830ea cp_parser_class_name
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:24190
0x886f96 cp_parser_qualifying_entity
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:6861
0x886f96 cp_parser_nested_name_specifier_opt
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:6543
0x887073 cp_parser_nested_name_specifier
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:6787
0x887127 cp_parser_ptr_operator
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:22243
0x87b800 cp_parser_declarator
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:21468
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.


I'm attempting to reduce a testcase which preserves the validity of the source
code, but this is proving to be much more expensive.

Reply via email to