Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Mike Stump
Wed, 08 Apr 1992 07:23
Re: g++ 2.1 global object instance initialization problem
Author: Mike Stump
Date: Wed, 08 Apr 1992 07:23
Date: Wed, 08 Apr 1992 07:23
89 lines
3160 bytes
3160 bytes
> Date: Mon, 6 Apr 92 19:15:01 EDT
> From: cmr!elvin!anders@mailer.cc.fsu.edu (Anders Franzen)
> To: bug-gcc@prep.ai.mit.edu
> Subject: g++ 2.1 global object instance initialization problem
Problems in the C++ part of the compiler should go to
bug-g++@prep.ai.mit.edu, not this list.
Your problem should be solved in the next release of gcc.
> BUG REPORT
> --------------
> FROM:
> --
> Anders Franzen | TEL: +1 904/422-3574 |
> Software Engineer | FAX: +1 904/386-2562 |
> TechnoTeacher, Inc. | |
> 1810 High Road | <anders@cmr.fsu.edu> |
> Tallahassee, FL 32303 | |
> PROGRAM: g++ SUBPROGRAM: cc1plus
> VERSION: 2.1
> SYSTEM: Sun 4/40 (IPC)
> OS: SunOS 4.1.1 Rev B.
> LOCAL INSTALLATION:
> gcc 2.1 was installed by patching the 2.0 distribution
> with the gcc.diff-2.0-2.1 file. The following commands were then
> issued to build and install the new release:
> configure sun4
> make LANGUAGES=c
> make stage1
> make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
> make stage2
> make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
> for file in *.o; do
> cmp $file stage2/$file
> done
> make CC=stage2/gcc install
> make install-fixincludes
> All of the above commands were successful.
> ---------------------------------------------------------------------
> BUG DESCRIPTION:
> The problem occurs when I try to use global instances of C++ objects
> with constructors as initializers.
> Here's an example of a global object array initialization. The
> following C++ code example (which I condensed from a much larger source)
> causes a signal 11, Segmentation fault, when compiled with g++ 2.1 on
> my system.
> -- Begin itest.cc
> class X {
> int i1;
> int i2;
> public:
> X(
> int ii1,
> char ii2
> )
> {
> i1 = ii1;
> i2 = ii2;
> }
> };
> X x[] = { X(1, 2) };
> -- End itest.cc
> Here is an example g++ compilation of the above example:
> anders@scofield 3% g++ -v -c itest.cc
> Reading specs from /usr/local/lib/gcc-lib/sun4/2.1/specs
> gcc version 2.1
> /usr/local/lib/gcc-lib/sun4/2.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix itest.cc /usr/tmp/cca06032.i
> GNU CPP version 2.1 (sparc)
> /usr/local/lib/gcc-lib/sun4/2.1/cc1plus /usr/tmp/cca06032.i -quiet -dumpbase itest.cc -version -o /usr/tmp/cca06032.s
> GNU C++ version 2.1 (sparc) compiled by GNU C version 2.1.
> /usr/local/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads