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

            Bug ID: 89138
           Summary: ICE on valid C++11 code: in expand_expr_real_1, at
                    expr.c:9993
           Product: gcc
           Version: unknown
            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 test seems to cause all versions since 4.x to crash. 

$ g++tk -v
Using built-in specs.
COLLECT_GCC=g++tk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/9.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 9.0.1 20190130 (experimental) [trunk revision 268383] (GCC) 
$ 
$ clang++ -std=c++11 -c tmp.cpp
$ 
$ g++tk -c tmp.cpp
during RTL pass: expand
tmp.cpp: In lambda function:
tmp.cpp:6:22: internal compiler error: in expand_expr_real_1, at expr.c:9993
    6 |   [&] { __typeof (b) c; } ();
      |                      ^
0xb4094b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc-source-trunk/gcc/expr.c:9987
0xb57c2c expand_expr
        ../../gcc-source-trunk/gcc/expr.h:279
0xb57c2c expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc-source-trunk/gcc/expr.c:8484
0xa088c0 expand_gimple_stmt_1
        ../../gcc-source-trunk/gcc/cfgexpand.c:3790
0xa088c0 expand_gimple_stmt
        ../../gcc-source-trunk/gcc/cfgexpand.c:3850
0xa0c44b expand_gimple_basic_block
        ../../gcc-source-trunk/gcc/cfgexpand.c:5886
0xa11e36 execute
        ../../gcc-source-trunk/gcc/cfgexpand.c:6509
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ 


--------------------------------


int a = 1;

void f ()
{
  int b[a];
  [&] { __typeof (b) c; } ();
}

Reply via email to