This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Internal compiler error in g++ from GCC2.95.2
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Internal compiler error in g++ from GCC2.95.2
- From: "James A. Bednar" <jbednar at cs dot utexas dot edu>
- Date: Sun, 30 Jan 2000 17:41:23 -0600
- Reply-to: jbednar at cs dot utexas dot edu
g++ 2.95.2 aborts unceremoniously when attempting to compile this
simple file:
class StringParser {
public:
StringParser() { }
~StringParser() { }
double& parse(const char* s, double& x) { return x=basicparse(s,x); }
template<class T> T& basicparse(const char* s, T& x) { return x; }
};
The code compiles fine under "gcc version egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)" on the same machine. The command line and
output are attached; the preprocessor output was the same as the above
except that it was prefixed with '# 1 "bug.c"'. Should this code
prove useful as a test case, I hereby place it into the public domain
for you or anyone else to use for whatever purpose you or they see fit.
Thanks,
Jim
-------------------------------------------------------------------------------
% g++ -v --save-temps -c bug.c
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ bug.c bug.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus bug.ii -quiet -dumpbase bug.cc -version -o bug.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
bug.c: In method `double & StringParser::basicparse<double>(const char *, double &)':
bug.c:6: instantiated from here
bug.c:7: Internal compiler error.
bug.c:7: Please submit a full bug report.
bug.c:7: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.