This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Compiler error #40 report


/*
 * gccbug.cpp
 *
 *	This little tiny program provokes a compiler bug in GCC "egcs-2.91.66" on
 *	a RedHat Linux 6.1 system. The C preprocessor output has been stripped down of
 *	everything that is not necessary to reproduce the bug.
 *
 *	The source code is clearly not valid C++ -- we know this -- but the error
 *	message asked us to report it. We believe this is not the latest version of
 *	the compiler, but I was not willing to locate a newer build just to report
 *	this bug. If the bug doesn't exist in the current version, of course please
 *	just drop this on the floor. Instead I put my time into making an easy-to-follow
 *	bug report that lives in a single file and is less than 3000 lines long.
 *
 *	I hope this is helpful.
 *
 *	-- Stephen J. Friedl / friedl@mtndew.com / 2000-03-22
 *
 *--------------------------------------------------------------------------------------------------

$ uname -a
Linux linux.mtndew.com 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown

$ egcs -v -c gccbug.cpp

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs

gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 \
	-D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ \
	-D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) \
	-D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ \
	-D__tune_i386__ gccbug.cpp /tmp/cc2V90Te.ii
GNU CPP version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++-2
 /usr/local/include
 /usr/i386-redhat-linux/include
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cc1plus /tmp/cc2V90Te.ii -quiet -dumpbase gccbug.cc \
	-version -o /tmp/ccMxktzl.s

GNU C++ version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386-redhat-linux) \
	compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
gccbug.cpp: In function `void format1()':
gccbug.cpp:66: warning: invalid use of type decl `typedef short int date' as expression
gccbug.cpp:66: warning: initialization to `char *' from `date' lacks a cast
gccbug.cpp:66: Internal compiler error 40.
gccbug.cpp:66: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
gccbug.cpp:66: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.

 *--------------------------------------------------------------------------------------------------
 */

typedef short date;

struct { } ar;

static void
format1(void)
{

char	*p = ar.date;		/* BUG IS HERE */

}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]