From: @ai.mit.edu (Richard Levitte, System Manager @ KTH/TTT, Stockholm)
Subject: BUG in cc1plus
      <richard@ttt.kth.se>
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 7 Sep 1992 17:12:28 GMT

Facts:	This bug appears both under SunOS 4.1.2 on a Sun-4, and under
	VAX/VMS 5.5-1 (and lower too).
	On the Sun-4, cc1plus gives a fatal singal 11.
	On the VAX, I get a traceback, which might be loaded with usefull info.

The following is the code:

---------------------------- FOO.CC -------------------------------------------
struct foo
{
  char *s;
  foo(char *x) { s=x; }
};

struct cookie
{
  foo * v;
  cookie ( foo * x) { v=x; }
};

cookie cat(&foo("apabepa"));
---------------------------- FOO.CC (eof) -------------------------------------

And here is the VMS printout of the compilation, with the traceback:

---------------------------- FOO.ERRLOG ---------------------------------------
$ set default USER2:[RICHARD.TMP]
$ gcc/plus/verbose=all foo.cc
$ gcc_cpp -+ "-D__GNUG__=2" "-D__cplusplus"  FOO.CC SYS$SCRATCH:GCC_20200429.CPP
$ gcc_cplus SYS$SCRATCH:GCC_20200429.CPP -dumpbase FOO -
   -mgnu "-O1" -mvaxc-alignment  -o SYS$SCRATCH:GCC_20200429.S
 foo::foo (char *)
 cookie::cookie (struct foo*)
 void  _GLOBAL_.I.cat ()
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=00000004, PC=0009B469, PSL=03C00000
%TRACE-F-TRACEBACK, symbolic stack dump follows
module name     routine name                     line       rel PC    abs PC
INTEGRATE       expand_inline_function           1101      00000083  0009B469
CALLS           expand_call                       592      00000184  000883EA
EXPR            expand_expr                      3591      00000DC0  0008473A
INTEGRATE       expand_inline_function           1160      0000018E  0009B574
CALLS           expand_call                       592      00000184  000883EA
EXPR            expand_expr                      3591      00000DC0  0008473A
STMT            expand_expr_stmt                 1226      00000095  0007DBB5
CP-INIT         expand_aggr_init_1               1412      000004EE  0005B10C
CP-INIT         expand_aggr_init                 1092      000000D6  0005AA20
CP-DECL2        finish_file                      2223      00000396  000356B2
CP-PARSE        yyparse                           499      0000072F  0002178D
TOPLEV          compile_file                     1638      00000706  0006DF6A
TOPLEV          main                             3055      000008E8  0006FC1E
%GCC-I-NOOBJECT No object file was produced.
---------------------------- FOO.ERRLOG (eof) ---------------------------------

If I split the last line of FOO.CC to be:

	foo dummy("apabepa");
	cookie cat(&dummy);

then everything works allright!

Thank you.

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
! Richard Levitte, System manager       ! tel: int+46-8-790 64 23           !
! Royal Institute of Technology         ! fax: int+46-8-791 76 54           !
! Department of Teletransmition Theory  ! Internet: richard@ttt.kth.se      !
! S-100 44 Stockholm, Sweden            !                                   !
!---------------------------------------------------------------------------!

Newsgroups: gnu.g++.bug