This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/78018] New: [C++14] "internal compiler error: Segmentation fault" with templates and lambdas


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

            Bug ID: 78018
           Summary: [C++14] "internal compiler error: Segmentation fault"
                    with templates and lambdas
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andipeer at gmx dot net
  Target Milestone: ---

Created attachment 39828
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39828&action=edit
Minimal working example for triggering the crash

Trying to compile the minimal working example that is attached, the compiler
crashes with a segfault. The exact output is stated below. The code should be
correct, as other compilers like Clang have no problem in compiling it.
Note that the bug does not occur if all methods of A are declared inline. Also
note that removing one element of the template-lambda call chain, the bug does
not occur, neither.

Command line: "g++ -std=c++14 -c error.cpp"

The error that is thrown is:

error.cpp: In member function ‘void A::f2(F) [with F =
A::f1()::<lambda(auto:1)>]’:
error.cpp:24:6: internal compiler error: Segmentation fault
 void A::f2(F f)
      ^
0xad48ef crash_signal
        ../../src/gcc/toplev.c:333
0xd286ba wi::extended_tree<128>::get_len() const
        ../../src/gcc/tree.h:5268
0xd286ba wi::int_traits<generic_wide_int<wi::extended_tree<128> >
>::decompose(long*, unsigned int, generic_wide_int<wi::extended_tree<128> >
const&)
        ../../src/gcc/wide-int.h:898
0xd286ba
wide_int_ref_storage<true>::wide_int_ref_storage<generic_wide_int<wi::extended_tree<128>
> >(generic_wide_int<wi::extended_tree<128> > const&, unsigned int)
        ../../src/gcc/wide-int.h:945
0xd286ba generic_wide_int<wide_int_ref_storage<true>
>::generic_wide_int<generic_wide_int<wi::extended_tree<128> >
>(generic_wide_int<wi::extended_tree<128> > const&, unsigned int)
        ../../src/gcc/wide-int.h:722
0xd286ba wi::unary_traits<generic_wide_int<wi::extended_tree<128> >
>::result_type wi::lshift<generic_wide_int<wi::extended_tree<128> >,
int>(generic_wide_int<wi::extended_tree<128> > const&, int const&)
        ../../src/gcc/wide-int.h:2847
0xd286ba int_bit_position(tree_node const*)
        ../../src/gcc/tree.h:5377
0xd286ba classify_argument
        ../../src/gcc/config/i386/i386.c:8095
0xd28b89 examine_argument
        ../../src/gcc/config/i386/i386.c:8409
0xd28de6 function_arg_advance_64
        ../../src/gcc/config/i386/i386.c:8822
0xd28de6 ix86_function_arg_advance
        ../../src/gcc/config/i386/i386.c:8915
0x8afd94 gimplify_parameters()
        ../../src/gcc/function.c:3999
0x8e5ef4 gimplify_body(tree_node*, bool)
        ../../src/gcc/gimplify.c:11522
0x8e6097 gimplify_function_tree(tree_node*)
        ../../src/gcc/gimplify.c:11682
0x7c5087 cgraph_node::analyze()
        ../../src/gcc/cgraphunit.c:625
0x7c7a2f analyze_functions
        ../../src/gcc/cgraphunit.c:1086
0x7c81a8 symbol_table::finalize_compilation_unit()
        ../../src/gcc/cgraphunit.c:2542

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]