https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86216
Bug ID: 86216
Summary: g++ ICE on valid code: verify_ssa failed
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: helloqirun at gmail dot com
Target Milestone: ---
g++8.1 emits yet another error...
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180619 (experimental) [trunk revision 261742] (GCC)
$ g++-trunk -c abc.c
abc.c: In lambda function:
abc.c:11:23: error: definition in block 2 follows the use
int main() { b(2, 3); }
^
for SSA_NAME: _1 in statement:
_1 = _1 + 1;
during GIMPLE pass: ssa
abc.c:11:23: internal compiler error: verify_ssa failed
0x108c557 verify_ssa(bool, bool)
../../gcc/gcc/tree-ssa.c:1188
0xdcc8ad execute_function_todo
../../gcc/gcc/passes.c:1950
0xdcd6be execute_todo
../../gcc/gcc/passes.c:1997
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.
$ g++-8.1 abc.c
during RTL pass: expand
abc.c: In lambda function:
abc.c:7:5: internal compiler error: in expand_expr_real_1, at expr.c:10001
n = sizeof(buffer1[n]);
^
0x5d5fbe expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-8.1.0/gcc/expr.c:9995
0x8e9202 expand_expr
../../gcc-8.1.0/gcc/expr.h:280
0x8e9202 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifi er)
../../gcc-8.1.0/gcc/expr.c:8466
0x7e9151 expand_gimple_stmt_1
../../gcc-8.1.0/gcc/cfgexpand.c:3729
0x7e9151 expand_gimple_stmt
../../gcc-8.1.0/gcc/cfgexpand.c:3790
0x7ea0df expand_gimple_basic_block
../../gcc-8.1.0/gcc/cfgexpand.c:5819
0x7ef4e6 execute
../../gcc-8.1.0/gcc/cfgexpand.c:6425
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.
$ cat abc.c
typedef int intptr_t;
template <typename T> void b(intptr_t n, T arg) {
typedef intptr_t ArrTy[arg];
ArrTy buffer2;
ArrTy buffer1[arg];
[&] {
n = sizeof(buffer1[n]);
[&] { n = sizeof(buffer2); }();
}();
}
int main() { b(2, 3); }