Egcs-20000530 bug sample code included
Timo Simanainen
Timo.Simanainen@lmf.ericsson.se
Tue Jun 6 03:20:00 GMT 2000
Hello,
There seems to be a quite a simple bug in the latest (as well
in older snapshots) compiler which is related to template code.
An example code is provided below. The preprocessed source file
contents is included as an attachment.
If you have any further question, please send the by e-mail,
since I'm not constantly following news or mailing-list.
Affected compiler & system info:
Gcc snapshot version: egcs-20000530
OS: Linux 2.2.15
binutils: 2.9.5.0.46
I have included an example piece of code which gives
the following error message as a compiling result:
#> g++ -Wall -g x.cpp -o t
x.cpp: In function `int main ()':
x.cpp:9: Internal compiler error 73.
x.cpp:9: Please submit a full bug report.
x.cpp:9: See <URL: http://www.gnu.org/software/gcc/bugs.html > for
instructions.
----------
// Template function generation directly from function return code seems
to
// fail. If same type of template function is used previously, no error
// occurs.
#include <string.h>
template <class type>
int
bits(type prm) {
return 0;
}
int
main() {
char *a="huuhaa";
size_t i;
// Uncomment next line to get rid of 'Internal error'
// bits(i=strlen(a));
bits(strlen(a));
}
-----------
Sincerely,
Timo Simanainen
x.ii.gz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.ii.gz
Type: application/x-gzip
Size: 1021 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000606/9a1c8391/attachment.bin>
More information about the Gcc-bugs
mailing list