[gnu.g++.bug] g++ 1.31 & libg++ 1.25 test4

sps@magoo.mcnc.org (Stephen Schaefer) (12/23/88)

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 test4.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:

Script started on Thu Dec 22 17:25:20 1988

simon:bin:234 g++ -v -g -fchar-charconst -I/usr/local/std/lib/g++-include -c test4.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 test4.cc /tmp/cc017154.cpp
GNU CPP version 1.31.0
 /usr/local/std/lib/gcc-c++ /tmp/cc017154.cpp -quiet -dumpbase test4.cc -fchar-charconst -noreg -version -G -o /tmp/cc017154.s
GNU C++ version 1.31.0 (vax) compiled by GNU C version 1.31.
In function fibonacci (struct Integer):
test4.cc:35: Segmentation violation
g++: Program c++ got fatal signal 11.
simon:bin:235 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:239 

script done on Thu Dec 22 17:28:48 1988
--
	Stephen P. Schaefer, Postmaster	MCNC
	sps@mcnc.org			P.O. Box 12889
	...!mcnc!sps			RTP, NC 27709