public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98570] New: ICE: canonical types differ for identical types
@ 2021-01-06 17:19 acoplan at gcc dot gnu.org
  2021-01-06 17:35 ` [Bug c++/98570] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-01-06 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98570
           Summary: ICE: canonical types differ for identical types
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

GCC ICEs on the following (on at least aarch64 and x86). The testcase was
reduced from polymake and is accepted by clang.

template <int a> struct b { static constexpr int c = a; };
template <int> struct h { typedef int d; };
template <bool e, typename> using f = typename h<e>::d;
namespace g {
  template <typename...> using i = b<false>;
  using j = long;
}
using g::i;
using g::j;
template <typename> using k = i<>;
template <typename... l> f<!i<l...>::c, j> m();
template <typename... n> f<!i<k<n>...>::c, j> m();

On AArch64, I can reproduce the ICE back to GCC 6. To reproduce:

$ aarch64-elf-gcc -c testcase.ii
testcase.ii:12:49: internal compiler error: canonical types differ for
identical types 'h<(! g::i<k<n>...>::c)>' and 'h<(! g::i<l ...>::c)>'
   12 | template <typename... n> f<!i<k<n>...>::c, j> m();
      |                                                 ^
0x9f85e5 comptypes(tree_node*, tree_node*, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1543
0x9f9900 same_type_ignoring_top_level_qualifiers_p(tree_node*, tree_node*)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1579
0x9f7827 structural_comptypes
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1423
0x9f8570 comptypes(tree_node*, tree_node*, int)
        /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1532
0x7b9309 decls_match(tree_node*, tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1026
0x7b983c decls_match(tree_node*, tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1080
0x7bacf8 duplicate_decls(tree_node*, tree_node*, bool, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1459
0x8aed4d do_pushdecl
        /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:3734
0x8b13cc do_pushdecl_with_scope
        /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:4881
0x8b1533 pushdecl_namespace_level(tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:6245
0x97701e push_template_decl(tree_node*, bool)
        /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:6049
0x7d1839 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:5531
0x8fc85e cp_parser_init_declarator
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:21659
0x8ff1fb cp_parser_single_declaration
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30427
0x8ff2f8 cp_parser_template_declaration_after_parameters
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:29999
0x8ffc2d cp_parser_explicit_template_declaration
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30265
0x8ffc2d cp_parser_template_declaration_after_export
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30284
0x90026a cp_parser_template_declaration
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:16533
0x909dcd cp_parser_declaration
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:14009
0x908f3b cp_parser_toplevel_declaration
        /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:14107
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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-03 17:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 17:19 [Bug c++/98570] New: ICE: canonical types differ for identical types acoplan at gcc dot gnu.org
2021-01-06 17:35 ` [Bug c++/98570] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2021-01-14 11:18 ` rguenth at gcc dot gnu.org
2021-01-22 16:05 ` jakub at gcc dot gnu.org
2021-01-22 16:19 ` mpolacek at gcc dot gnu.org
2021-01-27 20:31 ` jason at gcc dot gnu.org
2021-01-28 15:17 ` ppalka at gcc dot gnu.org
2021-02-01 14:50 ` cvs-commit at gcc dot gnu.org
2021-02-01 15:10 ` jason at gcc dot gnu.org
2021-02-03 17:51 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).