http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57102
Uros Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-05-04 Ever Confirmed|0 |1 --- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2013-05-04 18:48:32 UTC --- Confirmed, the segfault can be triggered with: ~/gcc-build/gcc/cc1plus -O2 -std=gnu++11 -fno-inline -fdump-final-insns=aaa The important part is "-fdump-final-insns=...". ... Performing interprocedural optimizations <*free_lang_data> <visibility> <early_local_cleanups> <*free_inline_summary> <whole-program> <profile_estimate> <cp> <inline> <pure-const> <static-var>Assembling functions: constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&) [with _Tp = <lambda()>; typename std::remove_reference<_Tp>::type = <lambda()>] constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&) [with _Tp = <lambda()>&; typename std::remove_reference<_Tp>::type = <lambda()>] std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Impl::_Impl(_Alloc) [with _Tp = std::__future_base::_Task_state<<lambda()>, __gnu_test::SimpleAllocator<int>, int()>; _Alloc = __gnu_test::SimpleAllocator<int>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u] std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = std::reference_wrapper<std::_Bind_simple<std::reference_wrapper<<lambda()> >()> >; <template-parameter-2-2> = void; _Res = int; _ArgTypes = {}] final.ii:765:61: internal compiler error: Segmentation fault packaged_task<int()> p(allocator_arg, a, []() { return 1; }); ^ 0xa94bff crash_signal ../../gcc-svn/trunk/gcc/toplev.c:333 0x54160b fndecl_declared_return_type(tree_node*) ../../gcc-svn/trunk/gcc/cp/decl.c:14388 0x5f620c dump_function_decl ../../gcc-svn/trunk/gcc/cp/error.c:1416 0x5f7b40 decl_as_string(tree_node*, int) ../../gcc-svn/trunk/gcc/cp/error.c:2642 0x69f562 cxx_printable_name_internal ../../gcc-svn/trunk/gcc/cp/tree.c:1953 0xa95312 announce_function(tree_node*) ../../gcc-svn/trunk/gcc/toplev.c:229 0x7c26f6 expand_function ../../gcc-svn/trunk/gcc/cgraphunit.c:1610 0x7c44d6 expand_all_functions ../../gcc-svn/trunk/gcc/cgraphunit.c:1744 0x7c44d6 compile() ../../gcc-svn/trunk/gcc/cgraphunit.c:2042 0x7c4b79 finalize_compilation_unit() ../../gcc-svn/trunk/gcc/cgraphunit.c:2119 0x5ea280 cp_write_global_declarations() ../../gcc-svn/trunk/gcc/cp/decl2.c:4330 Please submit a full bug report, It looks that compilation fails during IPO, trying to dump fndecl. gdb says: Program received signal SIGSEGV, Segmentation fault. 0x000000000054160b in fndecl_declared_return_type (fn=0x7ffff165ad00) at ../../gcc-svn/trunk/gcc/cp/decl.c:14388 14388 ->x_auto_return_pattern); (gdb) bt #0 0x000000000054160b in fndecl_declared_return_type (fn=0x7ffff165ad00) at ../../gcc-svn/trunk/gcc/cp/decl.c:14388 #1 0x00000000005f620d in dump_function_decl (t=0x7ffff165ad00, flags=4) at ../../gcc-svn/trunk/gcc/cp/error.c:1416 #2 0x00000000005f7b41 in decl_as_string (decl=0x7ffff165ad00, flags=4) at ../../gcc-svn/trunk/gcc/cp/error.c:2642 #3 0x000000000069f563 in cxx_printable_name_internal (decl=0x7ffff165ad00, v=2, translate=<optimized out>) at ../../gcc-svn/trunk/gcc/cp/tree.c:1953 #4 0x0000000000b2a8f9 in dump_function_header (dump_file=0x17cb5a0, fdecl=0x7ffff165ad00, flags=0) at ../../gcc-svn/trunk/gcc/tree-pretty-print.c:3138 #5 0x000000000087f4b1 in rest_of_clean_state () at ../../gcc-svn/trunk/gcc/final.c:4455 #6 0x00000000009f846f in execute_one_pass (pass=pass@entry=0x1639380 <pass_clean_state>) at ../../gcc-svn/trunk/gcc/passes.c:2337 (gdb) list 14383 fndecl_declared_return_type (tree fn) 14384 { 14385 fn = STRIP_TEMPLATE (fn); 14386 if (FNDECL_USED_AUTO (fn)) 14387 return (DECL_STRUCT_FUNCTION (fn)->language 14388 ->x_auto_return_pattern); 14389 else 14390 return TREE_TYPE (TREE_TYPE (fn)); 14391 } 14392