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

            Bug ID: 95618
           Summary: [11 Regression] ICE in remap_type_1, at
                    tree-inline.c:607
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-11.0.0-alpha20200607 snapshot (g:f08995eefbf579acfe40f0204727d5ce388e3d0a)
ICEs when compiling the following testcase reduced from
test/SemaTemplate/instantiate-self.cpp from the clang 10.0.0 test suite:

namespace test6 {
  template<typename T> constexpr T f(T);
  template<typename T> constexpr T g(T t) {
    typedef int arr[f(T())];
    return t;
  }
  template<typename T> constexpr T f(T t) {
    typedef int arr[g(T())];
    return t;
  }
  int n = f(0);
}

% g++-11.0.0 -c novdqht4.cpp
novdqht4.cpp: In function 'constexpr T test6::f(T) [with T = int]':
novdqht4.cpp:11:12:   in 'constexpr' expansion of 'test6::f<int>(0)'
novdqht4.cpp:8:22:   in 'constexpr' expansion of 'test6::g<int>(0)'
novdqht4.cpp:4:22:   in 'constexpr' expansion of 'test6::f<int>(0)'
novdqht4.cpp:11:14: internal compiler error: in remap_type_1, at
tree-inline.c:607
   11 |   int n = f(0);
      |              ^
0x76f65b remap_type_1
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:607
0x107c420 remap_type(tree_node*, copy_body_data*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:736
0x107c65d remap_decl(tree_node*, copy_body_data*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:400
0x107f754 remap_decls
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:785
0x107fae9 remap_block
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:843
0x1082889 copy_bind_expr
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:939
0x1082889 copy_tree_body_r(tree_node**, int*, void*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:1284
0x12cc28a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree.c:11957
0x1077830 copy_tree_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:3272
0x107d245 copy_fn(tree_node*, tree_node*&, tree_node*&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/tree-inline.c:6625
0x8ac08b get_fundef_copy
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:1243
0x8acc08 cxx_eval_call_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:2511
0x8af6a8 cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:5701
0x8b8b45 cxx_eval_store_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:4729
0x8af5ba cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:5810
0x8af43f cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:6203
0x8aeec0 cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:6021
0x8b08f5 cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:5879
0x8afcb4 cxx_eval_statement_list
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:5271
0x8afcb4 cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200607/work/gcc-11-20200607/gcc/cp/constexpr.c:6342

Reply via email to