https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71628
Bug ID: 71628 Summary: ICE on valid C++11 code (with lambda expression, __typeof operator and variable length array): verify_gimple failed Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following C++11 code causes an ICE when compiled with the current GCC trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. It also affects 4.8.x and later, and is a regression from 4.7.x. sica [159] % g++-4.7 -c small.cpp -std=c++11 sica [160] % sh $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160622 (experimental) [trunk revision 237715] (GCC) $ $ g++-4.7 -c -std=c++11 small.cpp $ clang++ -c -std=c++11 small.cpp $ $ g++-trunk -c -std=c++11 small.cpp small.cpp: In lambda function: small.cpp:6:5: error: Local declaration from a different function [&] { __typeof (a) x; } (); ^ D.2029 small.cpp:6:22: note: in statement [&] { __typeof (a) x; } (); ^ _1 = (sizetype) D.2029; small.cpp:6:5: error: Local declaration from a different function [&] { __typeof (a) x; } (); ^ D.2029 small.cpp:6:22: note: in statement [&] { __typeof (a) x; } (); ^ _5 = (sizetype) D.2029; small.cpp:6:5: internal compiler error: verify_gimple failed [&] { __typeof (a) x; } (); ^ 0xdff39f verify_gimple_in_cfg(function*, bool) ../../gcc-source-trunk/gcc/tree-cfg.c:5212 0xce9212 execute_function_todo ../../gcc-source-trunk/gcc/passes.c:1964 0xce9c0b execute_todo ../../gcc-source-trunk/gcc/passes.c:2016 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ ---------------------------------- int i; void foo () { int a[i]; [&] { __typeof (a) x; } (); }