Article View: gnu.g++.bug
Article #2102g++ 1.36.2 on Sun-4 OS-4 dumps core
From: Igor Metz
Date: Mon, 18 Dec 1989 10:16
Date: Mon, 18 Dec 1989 10:16
75 lines
2241 bytes
2241 bytes
Configuration:
Sun-4 SunOS 4.0.3
g++ 1.36.2 from interviews.stanford.edu
libg++ 1.36.1 from prep.ai.mit.edu
Problem:
g++ loops or dumps core (fatal signal 6)
Consider the following code
---------------------------------------------
class BinTree {
protected:
short d;
short n;
public:
BinTree(short dim, short N);
BinTree(short dim, short N) {
if ((dim*N + 1) <= 100) {
d = dim; n = N;
}
};
};
int
main() {
BinTree b(3,2);
}
---------------------------------------------
Compiling this gives:
g++ version 1.36.2 (based on GCC 1.36)
/usr/local/lib/1.36.2/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus
-Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ gaga2.cc /usr/tmp/cca17997.cpp
GNU CPP version 1.36
/usr/local/lib/1.36.2/gcc-cc1plus /usr/tmp/cca17997.cpp -quiet -dumpbase gaga2.cc -version -o /usr/tmp/cca17997.s
GNU C++ version 1.36.2 (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue
newg++: Program cc1plus got fatal signal 6.
Sometimes the compiler dumps core, sometimes it loops!!!
If I transform the code to
---------------------------------------------
class BinTree {
protected:
short d;
short n;
public:
BinTree(short dim, short N);
};
BinTree::BinTree(short dim, short N)
{
if ((dim*N + 1) <= 100) {
d = dim; n = N;
}
};
int
main() {
BinTree b(3,2);
}
---------------------------------------------
it compiles without any errors.
Igor Metz X400: metz@iam.unibe.ch
Institut fuer Informatik ARPA: metz%iam.unibe.ch@relay.cs.net
und angewandte Mathematik UUCP: ..!uunet!mcvax!iam.unibe.ch!metz
Universitaet Bern Phone: (0041) 31 65 49 90
Switzerland Fax: (0041) 31 65 39 65
Technical Details
Message-ID:
<1071*metz@iam.unibe.ch>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!iam.unibe.ch!metzShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!iam.unibe.ch!metz From: metz@iam.unibe.ch (Igor Metz) Newsgroups: gnu.g++.bug Subject: g++ 1.36.2 on Sun-4 OS-4 dumps core Message-ID: <1071*metz@iam.unibe.ch> Date: 18 Dec 89 10:16:21 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 75