c++/8535: internal compiler error on gcc-2.95.4

berg@adept.co.za berg@adept.co.za
Mon Nov 11 15:36:00 GMT 2002


>Number:         8535
>Category:       c++
>Synopsis:       internal compiler error on gcc-2.95.4
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 11 15:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Friedrich Bergmann
>Release:        2.95.4
>Organization:
>Environment:
standard installed gcc 2.95.4
with Debian linux 3.0
on Pentium II (Deschutes)
cpu MHz     : 300.013
cat /proc/version:
Linux version 2.4.16-686 (herbert@gondolin) (gcc version 2.95.4 20011006 (Debian prerelease)) #1 Wed Nov 28 09:27:17 EST 2001



>Description:
ICE when an uninitialized extern const int is used as size initializer for an array (of an enumeration).
the bug only appears in conjunction with the initvars() function which apparently has nothing to do with it. (i.e. if i only delete the initvars() function, gcc exits successfully)

compiler output with the -v option:
$ g++ -v bufferbot.brain.cpp

Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
 /usr/lib/gcc-lib/i386-linux/2.95.4/cpp0 -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__ bufferbot.brain.cpp bufferbot.brain.ii
GNU CPP version 2.95.4 20011002 (Debian prerelease) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.4/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../i386-linux/include
End of omitted list.
 /usr/lib/gcc-lib/i386-linux/2.95.4/cc1plus bufferbot.brain.ii -quiet -dumpbase bufferbot.brain.cc -version -o bufferbot.brain.s

>How-To-Repeat:
g++ bufferbot.brain.cpp
>Fix:
when i use a #define instead of an extern const int, the error does not appear.
when i remove the initvars() function, the error vanishes.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="bufferbot.brain.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bufferbot.brain.cpp"

CnR5cGVkZWYgZW51bSBCdWZmZXJCb3RfQWN0SWR7CglCT1RBQ1RfbnVsbD0wCn07Cgp0eXBlZGVm
IHN0cnVjdCBCdWZmZXJCb3RfQWN0ewoJQnVmZmVyQm90X0FjdElkIGFjdDsKCWxvbmcgZG91Ymxl
IGJ5dGVmYWN0b3I7Cn07CgoKZXh0ZXJuIGNvbnN0IGludCBCT1RBQ1RfQ09VTlQ7CgpjbGFzcyBC
dWZmZXJCb3QgewpwdWJsaWM6Cgl2b2lkIGluaXR2YXJzKCk7CgoJdm9pZCBjbGVhcigpOwoJQnVm
ZmVyQm90X0FjdCBvcmRlcltCT1RBQ1RfQ09VTlRdOwoJdW5zaWduZWQgaW50IGFjdHM7Cn07Cgpj
b25zdCBpbnQgQk9UQUNUX0NPVU5UPTM7Cgp2b2lkIEJ1ZmZlckJvdDo6aW5pdHZhcnMoKXsKCWNs
ZWFyKCk7Cn0KCnZvaWQgQnVmZmVyQm90OjpjbGVhcigpewoKCWFjdHM9MDsKCglmb3IgKGludCB4
PTA7eDxCT1RBQ1RfQ09VTlQ7eCsrKXsKCQlvcmRlclt4XS5hY3Q9Qk9UQUNUX251bGw7CgkJb3Jk
ZXJbeF0uYnl0ZWZhY3Rvcj0wLjA7Cgl9Cgp9CgoK



More information about the Gcc-bugs mailing list