Internal error in egcs 1.0.1
Adam P. Jenkins
ajenkins@cs.umass.edu
Tue Jan 20 10:57:00 GMT 1998
Hi, I get an internal compiler error when compiling the following code
with egcs 1.0.1. I know that the code below is illegal, since egcs
now correctly doesn't allow local or anonymous types to be passed as
template arguments.
------------------ tmp.cc ----------------
#include <algo.h>
template <class FI, class T> inline T
sumsq(FI first, FI last)
{
struct {
T operator()(T acc, T x) { return acc + x*x; }
} plussq;
return accumulate(first, last, (T)0, plussq);
}
int main()
{
int i[10];
return sumsq(i, i + 10);
}
-------------------------------------------
g++ -v tmp.cc
Reading specs from /usr/local/lib/gcc-lib/i386-linux/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
/usr/local/lib/gcc-lib/i386-linux/egcs-2.90.23/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -Asystem(unix) -Acpu(i386) -Amachine(i386) tmp.cc /tmp/cca01154.ii
GNU CPP version egcs-2.90.23 980102 (egcs-1.0.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++
/usr/local/include
/usr/local/i386-linux/include
/usr/local/lib/gcc-lib/i386-linux/egcs-2.90.23/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i386-linux/egcs-2.90.23/cc1plus /tmp/cca01154.ii -quiet -dumpbase tmp.cc -version -o /tmp/cca01154.s
GNU C++ version egcs-2.90.23 980102 (egcs-1.0.1 release) (i386-linux) compiled by GNU C version 2.7.2.3.
tmp.cc: In function `T sumsq(FI, FI)':
tmp.cc:6: Internal compiler error.
tmp.cc:6: Please submit a full bug report to `egcs-bugs@cygnus.com'.
I can send you the result of running "g++ -E tmp.cc" if you need it,
but it's about 11,000 lines long so I won't mail it unless you want
it. Here's the other vital statistics about my system:
CPU: Cyrix P133+
uname -a: Linux cmpsci9 2.0.32 #3 Thu Dec 25 21:13:23 EST 1997 i586 unknown
Distribution: RedHat 5.0 with glibc
Adam P. Jenkins
--
Adam P. Jenkins
ajenkins@cs.umass.edu
More information about the Gcc-bugs
mailing list