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++/16905] [3.4 regression] ICE (segfault) with exceptions


------- Additional Comments From rjpeters at klab dot caltech dot edu  2004-08-06 23:41 -------
(In reply to comment #3)
> Confirmed.
> 
> Here's something slightly smaller that crashed when compiled with "g++ -O"
> (regardless of using -funit-at-a-time or -fno-unit-at-a-time).

OK, I attached this smaller testcase as 'smaller.cc' ... it now gives the
following backtrace (crashing on the same line as did 'fail.C'):

#0  loop_optimize (f=0xf6e7a500, dumpfile=0xffffffa3, flags=10)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/loop.c:2774
#1  0x083a12ee in rest_of_handle_loop_optimize (decl=0x0, insns=0xf6e7a500)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/toplev.c:3051
#2  0x083a18be in rest_of_compilation (decl=0xf6da4ca8)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/toplev.c:3329
#3  0x083eecfb in tree_rest_of_compilation (fndecl=0xf6da4ca8, nested_p=false)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/tree-optimize.c:168
#4  0x08128744 in expand_body (fn=0xf6da4ca8)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/semantics.c:2932
#5  0x083f0b39 in cgraph_expand_function (node=0xf6da82f4)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cgraphunit.c:538
#6  0x083f0c12 in cgraph_assemble_pending_functions ()
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cgraphunit.c:144
#7  0x083f1b05 in cgraph_finalize_function (decl=0xf6da4ca8, nested=false)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cgraphunit.c:225
#8  0x08128a23 in expand_or_defer_fn (fn=0xf6da4ca8)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/semantics.c:3015
#9  0x080ef782 in cp_parser_function_definition_after_declarator (
    parser=0xf6d9d740, inline_p=false)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:14256
#10 0x080efb8d in cp_parser_init_declarator (parser=0xf6d9d740,
    decl_specifiers=0xf6da5820, prefix_attributes=0x0,
    function_definition_allowed_p=true, member_p=false,
    declares_class_or_enum=0, function_definition_p=0xfeee0ca7)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:14194
#11 0x080ea4d2 in cp_parser_simple_declaration (parser=0xf6d9d740,
    function_definition_allowed_p=true)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:6486
#12 0x080ea638 in cp_parser_block_declaration (parser=0xf6d9d740,
    statement_p=false)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:6402
#13 0x080f05ff in cp_parser_declaration (parser=0xf6d9d740)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:6322
#14 0x080f08bf in cp_parser_declaration_seq_opt (parser=0xf6d9d740)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:6231
#15 0x080f0a8b in c_parse_file ()
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/cp/parser.c:2319
#16 0x081795b2 in c_common_parse_file (set_yydebug=-93)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/c-opts.c:1237
#17 0x083a3edd in toplev_main (argc=4294967203, argv=0xfefb77bc)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/toplev.c:1822
#18 0x0817cf6e in main (argc=-93, argv=0xffffffa3)
    at /home/rjpeters/build/gcc-3.4-20040730/gcc/main.c:35


This is stretching my limits of gcc comprehension, but anyway here goes... the
segfault happens here

    at /home/rjpeters/build/gcc-3.4-20040730/gcc/loop.c:2774
2774                current_loop->vtop = insn;

which I guess is due to current_loop being NULL, and this seems to jibe with the
debug dumps that I also attached... in .03.eh the looks "look right" to my
untrained eye (either going LOOP_BEG/LOOP_CONT/LOOP_END or just
LOOP_BEG/LOOP_END). But, then in .04.jump there is now a NOTE_INSN_LOOP_VTOP
that is not contained within a LOOP_BEG/LOOP_END pair. Judging from the code
around the crash location in loop.c, I'd guess that the orphaned VTOP isn't
supposed to happen...

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16905


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