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

            Bug ID: 99063
           Summary: [9/10/11 Regression] ICE in prep_operand, at
                    cp/call.c:5842
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r8 (before 20180525) :


$ cat z1.cc
template <typename... a>
void f (a... n)
{
  do; while (--n); {}
}
void g ()
{
  f(3);
}


$ cat z2.cc
template <typename... a>
void f (a... n)
{
  do; while (n--); {}
}
void g ()
{
  f(1,2);
}


$ g++-11-20210207 -c z1.cc
z1.cc: In instantiation of 'void f(a ...) [with a = {int}]':
z1.cc:8:6:   required from here
z1.cc:4:14: internal compiler error: Segmentation fault
    4 |   do; while (--n); {}
      |              ^~~
0xcd922f crash_signal
        ../../gcc/toplev.c:327
0x66567d prep_operand
        ../../gcc/cp/call.c:5842
0x677955 build_new_op_1
        ../../gcc/cp/call.c:6224
0x6786c0 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ../../gcc/cp/call.c:6676
0x80d982 build_x_unary_op(unsigned int, tree_code, cp_expr, int)
        ../../gcc/cp/typeck.c:6136
0x7b5e11 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19737
0x7c6a67 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19084
0x7c65f8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18411
0x7c5c17 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18475
0x7ba4f3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:25835
0x7ba4f3 instantiate_body
        ../../gcc/cp/pt.c:25835
0x7bb580 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26124
0x7d5bab instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26203
0x6ecab2 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4965

Reply via email to