http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52527
Bug #: 52527 Summary: When using '-g', get an ICE: seg fault in add_name_attribute (called by modified_type_die) Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@cray.com Compiling a program that uses the Boost libraries, I see an ICE when using '-g' option. Unfortunately (or fortunately) the problem does NOT occur when I compile a preprocessed version of the code. $ g++ --version g++ (GCC) 4.6.2 20111026 (Cray Inc.) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -dH -c -g -O3 -DNDEBUG -DCPU_FREQ=2.8e9 -DHAVE_U1 -DHAVE_TwoU1 -DDISABLE_MATRIX_ELEMENT_ITERATOR_WARNING -DUseTwoU1 -I. -I../../framework -I../../../../boost_1_47_0 te_nn.cpp In file included from ../../framework/dmrg/mp_tensors/mps.hpp:14:0, from ../../framework/dmrg/mp_tensors/mps.h:94, from te_nn.cpp:28: ../../framework/dmrg/mp_tensors/contractions.h: In static member function 'static block_matrix<Matrix, SymmGroup> contraction::multiply_with_twosite(const block_matrix<Matrix, SymmGroup>&, const block_matrix<Matrix, SymmGroup>&, const Index<SymmGroup>&, const Index<SymmGroup>&, const Index<SymmGroup>&) [with Matrix = maquis::types::dense_matrix<std::complex<double> >, SymmGroup = NU1<2>]': ../../framework/dmrg/mp_tensors/contractions.h:778:5: internal compiler error: Segmentation fault g++: internal compiler error: Aborted (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. $ Here's the traceback: (gdb) bt #0 0x00007f21a8ca3945 in raise () from /lib64/libc.so.6 #1 0x00007f21a8ca4f21 in abort () from /lib64/libc.so.6 #2 0x000000000060cf95 in real_abort () at ../../xt-gcc-4.6.2/gcc/diagnostic.c:903 #3 diagnostic_action_after_output (context=0x1166d80, diagnostic=<optimized out>) at ../../xt-gcc-4.6.2/gcc/diagnostic.c:247 #4 0x000000000060d13f in diagnostic_report_diagnostic (context=0x1166d80, diagnostic=0x7fff3dff2480) at ../../xt-gcc-4.6.2/gcc/diagnostic.c:546 #5 0x000000000060e020 in internal_error (gmsgid=<optimized out>) at ../../xt-gcc-4.6.2/gcc/diagnostic.c:839 #6 0x00000000007bbbd0 in crash_signal (signo=11) at ../../xt-gcc-4.6.2/gcc/toplev.c:359 #7 <signal handler called> #8 0x000000000062842e in add_name_attribute (die=0x7f218b75d8c0, name_string=0x13 <Address 0x13 out of bounds>) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:17435 #9 0x00000000006356c8 in modified_type_die (type=0x7f21a62a32a0, is_const_type=0, is_volatile_type=<optimized out>, context_die=0x7f21a8b97000) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:13057 #10 0x0000000000636070 in force_type_die (type=0x7f21a62a32a0) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:20949 #11 0x0000000000630541 in dwarf2out_imported_module_or_decl_1 ( ---Type <return> to continue, or q <return> to quit--- decl=0x7f21a633b450, name=0x0, lexical_block=0x7f2195a60f78, lexical_block_die=0x7f218b75d870) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:21307 #12 0x0000000000630a98 in decls_for_scope (stmt=0x7f2195a60f78, context_die=0x7f218b75d870, depth=1) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:20788 #13 0x000000000063b6eb in gen_lexical_block_die (depth=1, context_die=<optimized out>, stmt=0x7f2195a60f78) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:19886 #14 gen_block_die (stmt=0x7f2195a60f78, context_die=<optimized out>, depth=1) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:20738 #15 0x0000000000630af6 in decls_for_scope (stmt=0x7f2195a9d000, context_die=0x7f218b75d500, depth=0) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:20802 #16 0x0000000000630d91 in gen_subprogram_die (decl=0x7f2197110e00, context_die=<optimized out>) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:19494 #17 0x00000000006335d8 in gen_decl_die (decl=0x7f2197110e00, origin=0x7f219a55f3f0, context_die=0x7f21a8b97000) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:21152 #18 0x000000000063c239 in dwarf2out_function_decl (decl=<optimized out>) at ../../xt-gcc-4.6.2/gcc/dwarf2out.c:21534 #19 0x000000000067150d in rest_of_handle_final () ---Type <return> to continue, or q <return> to quit--- at ../../xt-gcc-4.6.2/gcc/final.c:4301 #20 0x000000000072c669 in execute_one_pass (pass=0x115c560) at ../../xt-gcc-4.6.2/gcc/passes.c:1556 #21 0x000000000072c915 in execute_pass_list (pass=0x115c560) at ../../xt-gcc-4.6.2/gcc/passes.c:1611 #22 0x000000000072c927 in execute_pass_list (pass=0x115ce40) at ../../xt-gcc-4.6.2/gcc/passes.c:1612 #23 0x000000000072c927 in execute_pass_list (pass=0x115cea0) at ../../xt-gcc-4.6.2/gcc/passes.c:1612 #24 0x00000000007f9681 in tree_rest_of_compilation (fndecl=0x7f2197110e00) at ../../xt-gcc-4.6.2/gcc/tree-optimize.c:422 #25 0x000000000093ab0f in cgraph_expand_function (node=0x7f2195a5cc60) at ../../xt-gcc-4.6.2/gcc/cgraphunit.c:1576 #26 0x000000000093c76a in cgraph_expand_all_functions () at ../../xt-gcc-4.6.2/gcc/cgraphunit.c:1635 #27 cgraph_optimize () at ../../xt-gcc-4.6.2/gcc/cgraphunit.c:1899 #28 0x000000000093cb6a in cgraph_finalize_compilation_unit () at ../../xt-gcc-4.6.2/gcc/cgraphunit.c:1096 #29 0x00000000004f2af1 in cp_write_global_declarations () at ../../xt-gcc-4.6.2/gcc/cp/decl2.c:4000 #30 0x00000000007bda78 in compile_file () at ../../xt-gcc-4.6.2/gcc/toplev.c:591 ---Type <return> to continue, or q <return> to quit--- #31 do_compile () at ../../xt-gcc-4.6.2/gcc/toplev.c:1900 #32 toplev_main (argc=34, argv=0x7fff3dff32a8) at ../../xt-gcc-4.6.2/gcc/toplev.c:1963 #33 0x00007f21a8c8fbc6 in __libc_start_main () from /lib64/libc.so.6 #34 0x0000000000499fa9 in _start () at ../sysdeps/x86_64/elf/start.S:113 (gdb) Trying to create a preprocessed version of the test case results in the code being able to compile: $ g++ -dH -E -g -O3 -DNDEBUG -DCPU_FREQ=2.8e9 -DHAVE_U1 -DHAVE_TwoU1 -DDISABLE_MATRIX_ELEMENT_ITERATOR_WARNING -DUseTwoU1 -I. -I../../framework -I../../../../boost_1_47_0 te_nn.cpp >te_nn.i $ g++ -dH -c -g -O3 te_nn.i $ I will see if I can get permission to attach the test case. When I reduce the test case, the ICE still occurs but it points to a different source file in the test case code. This indicates that the problem may be caused not by the specific contents of the test case, but rather the size and number of header files being compiled.