Bug in egcs-1.0.3 and gcc-2.8.1

Takacs Balint takacs@cs.elte.hu
Fri Sep 4 08:02:00 GMT 1998


Hi!

During development I've founded the next problem with egcs-1.0.3 (and the
same with gcc-2.8.1). The following program will reproduce the bug:

#######################################################################

class MyClass
{
	public:
	virtual WillFail();
};

void main()
{
	MyClass * a;
	if (a->WillFail) {};
}

#######################################################################

Executing the next commandline (egcs is linked as gcc):

gcc -c -o bug.o bug.cpp

will result in:

bug.cpp: In function `int main(...)':
bug.cpp:10: Internal compiler error.
bug.cpp:10: Please submit a full bug report to `egcs-bugs@cygnus.com'.

or with gcc-2.8.1:

bug.cpp: In function `int main(...)':
bug.cpp:10: Internal compiler error.
bug.cpp:10: Please submit a full bug report to `bug-g++@prep.ai.mit.edu'.

This can be avoided by the next modification:
	if (a->WillFail()) {};
so everything works fine. To reproduce the bug it's important to define the
called member virtual; to call from a parenthesis (f.e. 'while' also good)
and to reach the member via a pointer. I don't know whether is it regular
to use a reference this way, I mean without the () - I never do this - but the
compiler shouldn't crash at a bad line ever.

The program compiles fine with gcc-2.7.2.3-9.

######################################################################

I don't think it is a machine dependent problem, because I've experienced
the same at the university's machines. Anyway I'll write a small
description about my PC. 

### specifications ###

Cyrix P150+ CPU (rev 6?) , Gigabyte HX motherboard. I once had some problems
with gcc-2.7.2.3-8, it made Sig11 errors, but RedHat made a patch available
for users with older Cyrix CPUs (gcc-2.7.2.3-9). The same problem doesn't
comes up with egcs or gcc-2.8.1. I use RedHat 5.1 Linux.

I compiled the egcs-1.0.3a.tar.gz package. I USED the --enable-haifa
during configure.  I compile often, and never experienced the same bug in
any "common" packages (like the kernel or KDE). 

The `gcc -v` results in:

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)

The `uname -a` results in:

Linux localhost.localdomain 2.0.34 #1 Tue Jun 16 23:23:15 MEST 1998 i586 unknown

The `cat /proc/cpuinfo` results in:

processor	: 0
cpu		: 586
model		: 6x86
vendor_id	: CyrixInstead
stepping	: unknown
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid		: yes
wp		: yes
flags		: fpu
bogomips	: 120.01

						Thank you.

							Balint Takacs
							takacs@cs.elte.hu






More information about the Gcc-bugs mailing list