This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Internal compiler error in g++ 2.95.2
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Internal compiler error in g++ 2.95.2
- From: Joel Yliluoma <bisqwit at iki dot fi>
- Date: Mon, 26 Jun 2000 03:56:06 +0300 (EEST)
- cc: Joel Yliluoma <bisqwit at iki dot fi>
An error appeared while I was trying to compile one complex program.
For your convenience, I made a short test program which
only contains the piece that causes the bug message.
Ask me if you need anything else than what is in this message.
oktober:~/src/pokemud# uname -a
Linux oktober 2.2.13 #5 SMP Thu Oct 28 09:37:49 EEST 1999 i686 unknown
oktober:~/src/pokemud# g++ -v --save-temps -Wall -W -g3 -pipe splittest.cc -o splittest
g++: Warning: -pipe ignored since -save-temps specified
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i586-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 -g3 -Wall -W -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ splittest.cc splittest.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/i586-pc-linux-gnu/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../i586-pc-linux-gnu/include
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/lib/qt/include
/usr/lib/qt/include
/usr/lib/qt/include
End of omitted list.
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cc1plus splittest.ii -quiet -dumpbase splittest.cc -g3 -Wall -W -version -o splittest.s
GNU C++ version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
splittest.cc: In method `void track::addrow<track>(track &, unsigned int)':
splittest.cc:12: instantiated from here
splittest.cc:21: Internal compiler error.
splittest.cc:21: Please submit a full bug report.
splittest.cc:21: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
I attached the resulting preprocessed file for investigation.
The full sourcecode is here:
class track
{
public:
unsigned dummy;
track split(unsigned row)
{
track first, second;
for(unsigned a=0; a<dummy; ++a)
if(a < row)
first.addrow(*this, a);
else
second.addrow(*this, a);
*this = second;
return first;
}
template <class T>
void addrow(T &pat, unsigned row)
{
row = *"Idea: I have a class named pattern"
"and a class named track, and there"
"would be two routines, addrow for"
"track and pattern, looking exactly"
"identical. Let's shorten it up."
"(This message was added here for the bug report only.)";
dummy = pat.dummy;
}
};
int main(void)
{
}
--
Joel Yliluoma - http://iki.fi/bisqwit/
This message is best viewed with PINE.
# 0 "splittest.cc"
#define __BASE_FILE__ "splittest.cc"
# 0 "splittest.cc"
#define __VERSION__ "2.95.2 19991024 (release)"
# 0 "splittest.cc"
#define __SIZE_TYPE__ unsigned int
# 0 "splittest.cc"
#define __PTRDIFF_TYPE__ int
# 0 "splittest.cc"
#define __WCHAR_TYPE__ __wchar_t
# 0 "splittest.cc"
#define __DATE__ "Jun 26 2000"
# 0 "splittest.cc"
#define __TIME__ "03:48:22"
# 0 "splittest.cc"
#define __STDC__ 1
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 0 "splittest.cc"
# 1 "splittest.cc"
class track
{
public:
unsigned dummy;
track split(unsigned row)
{
track first, second;
for(unsigned a=0; a<dummy; ++a)
if(a < row)
first.addrow(*this, a);
else
second.addrow(*this, a);
*this = second;
return first;
}
template <class T>
void addrow(T &pat, unsigned row)
{
row = *"Idea: I have a class named pattern"
"and a class named track, and there"
"would be two routines, addrow for"
"track and pattern, looking exactly"
"identical. Let's shorten it up."
"(This message was added here for the bug report only.)";
dummy = pat.dummy;
}
};
int main(void)
{
}