Path: utzoo!telly!ddsw1!lll-winken!killer!pollux!ti-csl!cs.utexas.edu!tut.cis.ohio-state.edu!rutgers!labrea!mcnc!speedy!sps From: sps@magoo.mcnc.org (Stephen Schaefer) Newsgroups: gnu.g++.bug Subject: Re: g++ 1.31 & libg++ 1.25 test5a & test5b Message-ID: Date: 23 Dec 88 16:50:40 GMT References: Sender: daemon@mcnc.org Distribution: gnu Organization: Microelectronics Center of North Carolina Lines: 106 Background: (repeated from my last posting - new stuff after diff) On a 4.3BSD Vax 8650, I have g++ 1.31 compiled with gcc 1.31, with fixes by Michael Tiemann to g++/cplus-init.c, g++/expr.c, g++/stmt.c, and reverse_condition made extern in gcc/jump.c. I get a segmentation violation when compiling test5[ab].cc, as included in libg++ 1.25. gcc-c++ wasn't producing any core file, although it did produce the ``Segmentation violation'' message, and g++ was reporting that gcc-c++ was killed with a fatal signal. The following change to the g++ code produced a core file for me: *** /tmp/,RCSt1010881 Thu Dec 22 17:53:20 1988 --- toplev.c Thu Dec 22 16:16:24 1988 *************** *** 1881,1884 **** --- 1881,1885 ---- { error ("Segmentation violation"); signal (SIGSEGV, SIG_DFL); + (void) kill(getpid(), SIGSEGV); } Then I could produce the following: simon:bin:140 g++ -v -g -fchar-charconst -I/usr/local/std/lib/g++-include -c test5a.cc g++ version 1.31.0 /usr/local/std/lib/gcc-cpp+ -v -I/usr/local/std/lib/g++-include -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix test5a.cc /tmp/cc009680.cpp GNU CPP version 1.31.0 /usr/local/std/lib/gcc-c++ /tmp/cc009680.cpp -quiet -dumpbase test5a.cc -fchar-charconst -noreg -version -G -o /tmp/cc009680.s GNU C++ version 1.31.0 (vax) compiled by GNU C version 1.31. test5a.cc:14: warning: lazy prototyping frowned upon test5a.cc:42: warning: lazy prototyping frowned upon test5a.cc:45: warning: lazy prototyping frowned upon test5a.cc:76: warning: lazy prototyping frowned upon test5a.cc:84: warning: lazy prototyping frowned upon In function MemoizedInteger::fibonacci (struct Integer): test5a.cc:273: Segmentation violation g++: Program c++ got fatal signal 11. simon:bin:141 gdb /usr/local/std/lib/gcc-c++ core GDB 2.5, Copyright (C) 1988 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /usr/local/std/lib/gcc-c++...done. Type "help" for a list of commands. (gdb) where #0 0xf779 in chainon (op1=(tree) 0x1dc688, op2=(tree) 0x1e3468) (tree.c line 777) #1 0x14d52 in poplevel (keep=1, reverse=1, functionbody=0) (cplus-decl.c line 735) #2 0x48750 in expand_inline_function (fndecl=(tree) 0x141908, parms=(tree) 0x1def08, target=(rtx) 0x0, ignore=1, type=(tree) 0xa3824, structure_value_addr=(rtx) 0x0) (integrate.c line 939) #3 0x324e8 in expand_call (exp=(tree) 0x1e2b6c, target=(rtx) 0x0, ignore=1, modifier=EXPAND_NORMAL) (expr.c line 4123) #4 0x305bc in expand_expr (exp=(tree) 0x1e2b6c, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 2720) #5 0x34ec5 in expand_expr_stmt (exp=(tree) 0x1e2b6c) (stmt.c line 929) #6 0x855f8 in expand_delete (type=(tree) 0x13fb70, addr=(tree) 0x1d8f84, auto_delete=669636) (cplus-init.c line 2307) #7 0x31553 in expand_expr (exp=(tree) 0x1d9408, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 3294) #8 0x360f8 in expand_cleanups (list=(tree) 0x9e310, dont_do=(tree) 0x0) (stmt.c line 1902) #9 0x36120 in fixup_cleanups (list=(tree) 0x9e310, before_jump=(rtx *) 0x1decfc) (stmt.c line 1918) #10 0x34974 in fixup_gotos (stack_level=(rtx) 0x0, cleanup_list=(tree) 0x0, first_insn=(rtx) 0x1d7014, dont_jump_in=0) (stmt.c line 696) #11 0x384e3 in fixup_parm_cleanups (after=(rtx) 0x1e1c84, before=(rtx) 0x1e1d24, end=(rtx) 0x1e2aa8) (stmt.c line 3733) #12 0x1ecee in finish_function (call_poplevel=0) (cplus-decl.c line 6451) #13 0xa5d0 in yyparse () (cplus-parse.y line 251) #14 0x136e in compile_file (name=(char *) 0x7fffe8cc "/tmp/cc017185.cpp") (toplev.c line 1010) #15 0x2c67 in main (argc=11, argv=(char **) 0x7fffe848, envp=(char **) 0x7fffe878) (toplev.c line 1824) (gdb) quit simon:bin:142 g++ -v -g -fchar-charconst -I/usr/local/std/lib/g++-include -c test5b.cc g++ version 1.31.0 /usr/local/std/lib/gcc-cpp+ -v -I/usr/local/std/lib/g++-include -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix test5b.cc /tmp/cc009694.cpp GNU CPP version 1.31.0 /usr/local/std/lib/gcc-c++ /tmp/cc009694.cpp -quiet -dumpbase test5b.cc -fchar-charconst -noreg -version -G -o /tmp/cc009694.s GNU C++ version 1.31.0 (vax) compiled by GNU C version 1.31. test5b.cc:13: warning: lazy prototyping frowned upon test5b.cc:13: warning: lazy prototyping frowned upon test5b.cc:13: warning: lazy prototyping frowned upon test5b.cc:13: warning: lazy prototyping frowned upon In function MemoizedIntegerBase::indexOf (struct MemoizedIntegerElem &): test5b.cc:79: warning: variable `i' never used In function MemoizedInteger::fibonacci (struct Integer): test5b.cc:122: Segmentation violation g++: Program c++ got fatal signal 11. simon:bin:143 gdb /usr/local/std/lib/gcc-c++ core GDB 2.5, Copyright (C) 1988 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /usr/local/std/lib/gcc-c++...done. Type "help" for a list of commands. (gdb) where #0 0xf779 in chainon (op1=(tree) 0x1dc688, op2=(tree) 0x1e3468) (tree.c line 777) #1 0x14d52 in poplevel (keep=1, reverse=1, functionbody=0) (cplus-decl.c line 735) #2 0x48750 in expand_inline_function (fndecl=(tree) 0x141908, parms=(tree) 0x1def08, target=(rtx) 0x0, ignore=1, type=(tree) 0xa3824, structure_value_addr=(rtx) 0x0) (integrate.c line 939) #3 0x324e8 in expand_call (exp=(tree) 0x1e2b6c, target=(rtx) 0x0, ignore=1, modifier=EXPAND_NORMAL) (expr.c line 4123) #4 0x305bc in expand_expr (exp=(tree) 0x1e2b6c, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 2720) #5 0x34ec5 in expand_expr_stmt (exp=(tree) 0x1e2b6c) (stmt.c line 929) #6 0x855f8 in expand_delete (type=(tree) 0x13fb70, addr=(tree) 0x1d8f84, auto_delete=669636) (cplus-init.c line 2307) #7 0x31553 in expand_expr (exp=(tree) 0x1d9408, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 3294) #8 0x360f8 in expand_cleanups (list=(tree) 0x9e310, dont_do=(tree) 0x0) (stmt.c line 1902) #9 0x36120 in fixup_cleanups (list=(tree) 0x9e310, before_jump=(rtx *) 0x1decfc) (stmt.c line 1918) #10 0x34974 in fixup_gotos (stack_level=(rtx) 0x0, cleanup_list=(tree) 0x0, first_insn=(rtx) 0x1d7014, dont_jump_in=0) (stmt.c line 696) #11 0x384e3 in fixup_parm_cleanups (after=(rtx) 0x1e1c84, before=(rtx) 0x1e1d24, end=(rtx) 0x1e2aa8) (stmt.c line 3733) #12 0x1ecee in finish_function (call_poplevel=0) (cplus-decl.c line 6451) #13 0xa5d0 in yyparse () (cplus-parse.y line 251) #14 0x136e in compile_file (name=(char *) 0x7fffe8cc "/tmp/cc017185.cpp") (toplev.c line 1010) #15 0x2c67 in main (argc=11, argv=(char **) 0x7fffe848, envp=(char **) 0x7fffe878) (toplev.c line 1824) (gdb) quit -- Stephen P. Schaefer, Postmaster MCNC sps@mcnc.org P.O. Box 12889 ...!mcnc!sps RTP, NC 27709