This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12162] New: strstream.cc:353: internal compiler error: Segmentation fault
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Sep 2003 00:02:44 -0000
- Subject: [Bug c++/12162] New: strstream.cc:353: internal compiler error: Segmentation fault
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12162
Summary: strstream.cc:353: internal compiler error: Segmentation
fault
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danglin at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,rth at redhat dot com
GCC build triplet: hppa-unknown-gnu-linux
GCC host triplet: hppa-unknown-gnu-linux
GCC target triplet: hppa-unknown-gnu-linux
/home/dave/gcc-3.4/objdir/gcc/xgcc -shared-libgcc -B/home/dave/gcc-3.4/objdir/gc
c/ -nostdinc++ -L/home/dave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src -L/home/d
ave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs -B/home/dave/opt/gnu/hppa-l
inux/bin/ -B/home/dave/opt/gnu/hppa-linux/lib/ -isystem /home/dave/opt/gnu/hppa-
linux/include -isystem /home/dave/opt/gnu/hppa-linux/sys-include -I/home/dave/gc
c-3.4/objdir/hppa-linux/libstdc++-v3/include/hppa-linux -I/home/dave/gcc-3.4/obj
dir/hppa-linux/libstdc++-v3/include -I/home/dave/gcc-3.4/gcc/libstdc++-v3/libsup
c++ -O2 -g -O2 -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W
-Wwrite-strings -fdiagnostics-show-location=once -ffunction-sections -fdata-sec
tions -I/home/dave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/include/backward -Wno-
deprecated -c ../../../../gcc/libstdc++-v3/src/strstream.cc -fPIC -DPIC -o .lib
s/strstream.o
../../../../gcc/libstdc++-v3/src/strstream.cc: In member function `void std::ist
rstream::_ZTv0_n12_NSt10istrstreamD1Ev()':
../../../../gcc/libstdc++-v3/src/strstream.cc:353: internal compiler error: Segm
entation fault
The program segfaults here:
virtual std::istrstream::~istrstream()
Program received signal SIGSEGV, Segmentation fault.
set_mem_attributes_minus_bitpos (ref=0x41bdde90, t=0x41be4e70, objectp=1,
bitpos=0) at ../../gcc/gcc/emit-rtl.c:1811
1811 tree expr = MEM_EXPR (ref);
(gdb) p debug_rtx (ref)
(reg/v/f:SI 3 %r3 [orig:94 this ] [94])
Somehow, we are trying to set MEM atributes in a register. The backtrace is:
#0 set_mem_attributes_minus_bitpos (ref=0x41bdde90, t=0x41be4e70, objectp=1,
bitpos=0) at ../../gcc/gcc/emit-rtl.c:1811
#1 0x00384f88 in layout_decl (decl=0x41be4e70, known_align=0)
at ../../gcc/gcc/stor-layout.c:532
#2 0x000511f4 in require_complete_types_for_parms (parms=0x41be4e70)
at ../../gcc/gcc/cp/decl.c:11791
#3 0x0005803c in check_function_type (decl=0x415d4b60,
current_function_parms=0x41be4e70) at ../../gcc/gcc/cp/decl.c:13333
#4 0x00058d7c in start_function (declspecs=0x415d04d0, declarator=0x415d4b60,
attrs=0x54aaf8, flags=4751028) at ../../gcc/gcc/cp/decl.c:13539
#5 0x00117084 in use_thunk (thunk_fndecl=0x415d4b60, emit_p=180)
at ../../gcc/gcc/cp/method.c:435
#6 0x00129fdc in emit_associated_thunks (fn=0x5e)
at ../../gcc/gcc/cp/semantics.c:2850
#7 0x0012a18c in expand_body (fn=0x415d42a0)
at ../../gcc/gcc/cp/semantics.c:2900
#8 0x00139c2c in maybe_clone_body (fn=0x415d0540)
at ../../gcc/gcc/cp/optimize.c:276
#9 0x0012a2f8 in expand_or_defer_fn (fn=0x415d0540)
at ../../gcc/gcc/cp/semantics.c:2945
#10 0x000e6b28 in cp_parser_function_definition_after_declarator (
parser=0x4021f340, inline_p=64) at ../../gcc/gcc/cp/parser.c:13589
#11 0x000e6a38 in cp_parser_function_definition_from_specifiers_and_declarator
(parser=0x4021f340, decl_specifiers=0x41be4e70, attributes=0x1,
declarator=0x0) at ../../gcc/gcc/cp/parser.c:13528
#12 0x000e0a1c in cp_parser_init_declarator (parser=0x4021f340,
decl_specifiers=0x0, prefix_attributes=0x0,
function_definition_allowed_p=true, member_p=false,
declares_class_or_enum=33554432, function_definition_p=0xfaf00f48)
at ../../gcc/gcc/cp/parser.c:9364
#13 0x000dcb2c in cp_parser_simple_declaration (parser=0x4021f340,
function_definition_allowed_p=true) at ../../gcc/gcc/cp/parser.c:6161
#14 0x000dc968 in cp_parser_block_declaration (parser=0x4021f340,
statement_p=false) at ../../gcc/gcc/cp/parser.c:6077
#15 0x000dc784 in cp_parser_declaration (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:5997
#16 0x000dc5d4 in cp_parser_declaration_seq_opt (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:5906
#17 0x000e01a8 in cp_parser_namespace_definition (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:8905
#18 0x000dc858 in cp_parser_declaration (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:5992
#19 0x000dc5d4 in cp_parser_declaration_seq_opt (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:5906
#20 0x000d7eec in cp_parser_translation_unit (parser=0x4021f340)
at ../../gcc/gcc/cp/parser.c:2161
#21 0x000e81b4 in c_parse_file () at ../../gcc/gcc/cp/parser.c:14472
#22 0x0017ffa0 in c_common_parse_file (set_yydebug=1102962320)
at ../../gcc/gcc/c-opts.c:1210
#23 0x0038d254 in compile_file () at ../../gcc/gcc/toplev.c:1737
#24 0x00392320 in do_compile () at ../../gcc/gcc/toplev.c:4412
#25 0x0039243c in toplev_main (argc=46, argv=0xfaf0083c)
at ../../gcc/gcc/toplev.c:4452
I suspect the following change because if involves start_function but
I haven't confirmed that it actually causes the problem:
2003-08-29 Richard Henderson <rth@redhat.com>
Jason Merrill <jason@redhat.com>
* cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New.
(LANG_HOOKS_RTL_EXPAND_STMT): New.
* cp-tree.h (cxx_expand_function_start): Declare.
* decl.c (start_function): Use allocate_struct_function.
Move stmts_are_full_exprs_p assertion from expand_body.
Do not free_after_parsing or free_after_compilation.
(cxx_push_function_context): Move code to set struct function
data from genrtl_start_function.
* optimize.c (optimize_function): Don't inc/dec function_depth.
* semantics.c (expand_body): Use tree_rest_of_compilation.
(cxx_expand_function_start): Rename from genrtl_start_function,
omit bits done by tree_rest_of_compilation.
(genrtl_finish_function): Remove.
(clear_decl_rtl): Move to ../tree-optimize.c.
However, the problem was introduced after Aug. 29, 00:00:00 UTC.