bug in g++

simon@u-bourgogne.fr simon@u-bourgogne.fr
Mon Mar 31 10:11:00 GMT 2003


Dear Sir,

Here is what seams to be a bug in g++

Identical on two machines :

1) Celeron 1200Mhz, RAM 256 Mo, Linux Mandrake 9.0

[simon@altig bug]$ gcc -c bug.cc
bug.cc: In function `void func(S_Token*)':
bug.cc:8: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/> for instructions.

simon@altig bug]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enablee-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)


2) Pentium 3, 350MHz, RAM 128 Mo, Linux Redhat 8.0

[visit1@fermi bug]$ gcc -c bug.cc &
[1] 18464
[visit1@fermi bug]$ bug.cc: In function `void func(S_Token*)':
bug.cc:8: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

[1]+  Exit 1                  gcc -c bug.cc
visit1@fermi bug]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --hoost=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

/*Here starts the source file bug.cc
which contains an obvious nesting mistake line 8
Note that the suffix .cc seems here to be important.
These comments are not part of the source file (for lines counting) which starts with typedef struct...*/

typedef struct S_Token
	{
	char token ;
	} ;

void func(S_Token *ptr_token)
	{
	if('E' == ptr_token[0].token) && ('F' == ptr_token[1].token))
		{
		}
	return ;
	}

/* Here ends the source file bug.cc*/

The souce file being so short, I see no point to give more details.
Sincerely yours,

Jacques Simon
Département de Mathématiques
UFR Sciences et Techniques
9, avenue Savary
B.P. 47 870
21078 Dijon Cedex
e-mail  simon@u-bourgogne.fr
Burgundy Editor  http://www.u-bourgogne.fr/monge/j.simon



More information about the Gcc-bugs mailing list