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

            Bug ID: 107198
           Summary: [13 Regression] ICE in cp_gimplify_expr, at
                    cp/cp-gimplify.cc:752
           Product: gcc
           Version: 13.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++ 13.0.0 20221009 snapshot (g:e95e91eccd022a4a3a86da2749809fbad9afd20e) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/eh/aggregate1.C, w/ -fno-exceptions:

struct A {
  A() { throw 0; }
  A(int i) { throw i; }
  A(const A&) { throw 10; }
};

void try_idx (int i)
{
  int t = 10;
  try {
    struct X {
      A e1[2], e2;
    }
    x2[3] = { { 1, 2, 3 }, { 4, 5, 6 } };
  } catch (int x) { t = x; }
}

% g++-13 -fno-exceptions -c bqn7qvfj.C
bqn7qvfj.C: In constructor 'A::A()':
bqn7qvfj.C:2:15: error: exception handling disabled, use '-fexceptions' to
enable
    2 |   A() { throw 0; }
      |               ^
bqn7qvfj.C: In function 'void try_idx(int)':
bqn7qvfj.C:15:25: error: 'x' was not declared in this scope
   15 |   } catch (int x) { t = x; }
      |                         ^
bqn7qvfj.C:14:40: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.cc:752
   14 |     x2[3] = { { 1, 2, 3 }, { 4, 5, 6 } };
      |                                        ^
0x6b0a60 cp_gimplify_expr(tree_node**, gimple**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/cp/cp-gimplify.cc:752
0xef9bb6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16237
0xf00459 gimplify_init_ctor_eval_range
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:4881
0xf00459 gimplify_init_ctor_eval
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:4960
0xf002c5 gimplify_init_ctor_eval
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:4985
0xf00b93 gimplify_init_constructor
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:5399
0xf0e0db gimplify_modify_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6076
0xefa515 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16328
0xf0c307 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xf0c307 gimplify_compound_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6380
0xefad3c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16318
0xefce06 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xefe5fc gimplify_cleanup_point_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6928
0xefb05a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16721
0xefce06 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xefb7a3 gimplify_statement_list
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:2021
0xefb7a3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16773
0xefce06 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xefb7a3 gimplify_statement_list
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:2021
0xefb7a3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16773

Reply via email to