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

            Bug ID: 84767
           Summary: [6/7/8 Regression] ICE with pointer to VLA
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid testcase triggers an ICE since GCC 4.9.0:

========================
struct A
{
  A(int);
};

A::A(int i)
{
  int (*x)[1][i];
  (*x)[0][0] = 0;
}
========================

bug.cc: In constructor 'A::A(int)':
bug.cc:6:1: error: Local declaration from a different function
 A::A(int i)
 ^
i
bug.cc:8:16: note: in statement
   int (*x)[1][i];
                ^
_17 = (ssizetype) i;
during GIMPLE pass: cfg
bug.cc:6:1: internal compiler error: verify_gimple failed
 A::A(int i)
 ^
0xefdae3 verify_gimple_in_cfg(function*, bool)
        ../../gcc/gcc/tree-cfg.c:5579
0xde4f0f execute_function_todo
        ../../gcc/gcc/passes.c:1994
0xde5e5e execute_todo
        ../../gcc/gcc/passes.c:2048
Please submit a full bug report, [etc.]

Reply via email to