http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53697
Bug #: 53697
Summary: [4.7/4.8 Regression] ICE: in get_expr_operands, at
tree-ssa-operands.c:990 with lambda function
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 27632
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27632
preprocessed source
GCC 4.8 needs -fkeep-inline-functions to crash, 4.7 doesn't need any special
argument; 4.6 accepts the code fine.
Compiler output - 4.8:
$ gcc -fkeep-inline-functions tmp.ii
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C: In
member function 'void A::g()':
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:10:21:
warning: lambda expressions only available with -std=c++11 or -std=gnu++11
[enabled by default]
[this]{ f<T>(); }();
^
unhandled expression in get_expr_operands():
<field_decl 0x7fa7df3678e8 __this
type <pointer_type 0x7fa7df36e348
type <record_type 0x7fa7df368e70 A type_5 type_6 QI
size <integer_cst 0x7fa7df1faf40 constant 8>
unit size <integer_cst 0x7fa7df1faf60 constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7fa7df368e70 fields
<type_decl 0x7fa7df365958 A> context <translation_unit_decl 0x7fa7df212170 D.1>
full-name "struct A"
X() X(constX&) this=(X&) n_parents=0 use_template=0
interface-unknown
pointer_to_this <pointer_type 0x7fa7df36e2a0> chain <type_decl
0x7fa7df3658a0 A>>
readonly sizes-gimplified unsigned type_6 DI
size <integer_cst 0x7fa7df1fadc0 constant 64>
unit size <integer_cst 0x7fa7df1fade0 constant 8>
align 64 symtab 0 alias set -1 canonical type 0x7fa7df36e348>
readonly used unsigned nonlocal decl_7 DI file
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C line 10
col 6 size <integer_cst 0x7fa7df1fadc0 64> unit size <integer_cst
0x7fa7df1fade0 8>
align 64 offset_align 128
offset <integer_cst 0x7fa7df1fae00 type <integer_type 0x7fa7df214000
sizetype> constant 0>
bit offset <integer_cst 0x7fa7df1fae40 type <integer_type 0x7fa7df2140a8
bitsizetype> constant 0> context <record_type 0x7fa7df376150 __lambda0> chain
<type_decl 0x7fa7df373508 __lambda0>>
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C: In
lambda function:
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:17:2:
internal compiler error: in get_expr_operands, at tree-ssa-operands.c:990
};
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
(gdb) bt
#0 internal_error (gmsgid=0x162eda5 "in %s, at %s:%d") at
/mnt/svn/gcc-trunk/gcc/diagnostic.c:951
#1 0x0000000001305184 in fancy_abort (file=<optimized out>, line=990,
function=0x1428b60 "get_expr_operands")
at /mnt/svn/gcc-trunk/gcc/diagnostic.c:1011
#2 0x0000000000ca2e54 in get_expr_operands (stmt=0x7ffff5be9120,
expr_p=<optimized out>, flags=<optimized out>)
at /mnt/svn/gcc-trunk/gcc/tree-ssa-operands.c:990
#3 0x0000000000ca3adf in parse_ssa_operands (stmt=0x7ffff5be9120) at
/mnt/svn/gcc-trunk/gcc/tree-ssa-operands.c:1039
#4 0x0000000000ca57c4 in build_ssa_operands (stmt=<optimized out>) at
/mnt/svn/gcc-trunk/gcc/tree-ssa-operands.c:1054
#5 update_stmt_operands (stmt=0x7ffff5be9120) at
/mnt/svn/gcc-trunk/gcc/tree-ssa-operands.c:1226
#6 0x0000000000be94f8 in update_stmt (s=0x7ffff5be9120) at
/mnt/svn/gcc-trunk/gcc/gimple.h:1557
#7 mark_def_sites (kills=0x1b2dba0, stmt=0x7ffff5be9120, bb=0x7ffff5bf4000) at
/mnt/svn/gcc-trunk/gcc/tree-into-ssa.c:740
#8 mark_def_sites_block (walk_data=<optimized out>, bb=0x7ffff5bf4000) at
/mnt/svn/gcc-trunk/gcc/tree-into-ssa.c:2368
#9 0x0000000001213a9b in walk_dominator_tree (walk_data=0x7fffffffd400,
bb=0x7ffff5bf4000) at /mnt/svn/gcc-trunk/gcc/domwalk.c:188
#10 0x0000000000beda11 in mark_def_site_blocks () at
/mnt/svn/gcc-trunk/gcc/tree-into-ssa.c:2405
#11 rewrite_into_ssa () at /mnt/svn/gcc-trunk/gcc/tree-into-ssa.c:2494
#12 0x0000000000aa8195 in execute_one_pass (pass=0x1955900) at
/mnt/svn/gcc-trunk/gcc/passes.c:2164
#13 0x0000000000aa8555 in execute_pass_list (pass=0x1955900) at
/mnt/svn/gcc-trunk/gcc/passes.c:2219
#14 0x0000000000aa768d in do_per_function_toporder (callback=0xaa8540
<execute_pass_list(opt_pass*)>, data=0x1955ae0)
at /mnt/svn/gcc-trunk/gcc/passes.c:1703
#15 0x0000000000aa89f6 in execute_ipa_pass_list (pass=0x1953f00) at
/mnt/svn/gcc-trunk/gcc/passes.c:2537
#16 0x00000000008573f2 in ipa_passes () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1844
#17 compile () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1967
#18 0x0000000000857b45 in finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:2095
#19 0x0000000000676a2b in cp_write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/cp/decl2.c:4024
#20 0x0000000000b944ac in compile_file () at
/mnt/svn/gcc-trunk/gcc/toplev.c:566
#21 do_compile () at /mnt/svn/gcc-trunk/gcc/toplev.c:1870
#22 toplev_main (argc=13, argv=0x7fffffffd708) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1946
#23 0x00007ffff61b62ad in __libc_start_main () from /lib64/libc.so.6
#24 0x0000000000597d21 in _start ()
Compiler output - 4.7:
$ gcc lambda-template5.ii
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C: In
member function 'void A::g()':
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:10:21:
warning: lambda expressions only available with -std=c++11 or -std=gnu++11
[enabled by default]
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C: In
instantiation of 'A::g() [with T = int]::<lambda()>':
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:10:6:
required from 'struct A::g() [with T = int]::<lambda()>'
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:10:5:
required from 'void A::g() [with T = int]'
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:15:12:
required from here
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C:10:13:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Tested revisions:
r188682 - crash
4.7 r188682 - crash
4.6 r188682 - OK