compiler internal error for the large automatic array. AMD64
Murakami Hiroshi
dm@tmca.ac.jp
Sun Jan 11 11:11:00 GMT 2004
Dear, GCC bugs,
This shows a sample off C source code
that produces the gcc compiler internal error.
gcc 3.3.1 on AMD-x64 system on Mandrake Linux for AMD64.
Hiroshi Murakami <dm@tmca.ac.jp>
-----
Script started on Sun 11 Jan 2004 07:59:24 PM EST
$
$ cc -v
Reading specs from /usr/lib64/gcc-lib/amd64-mandrake-linux-gnu/3.3.1/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64
--with-slibdir=/lib64 --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --enable-long-long
--enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java,pascal
--host=amd64-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-4mdk)
$
$
$ cc a.c
a.c: In function `main':
a.c:27: error: unrecognizable insn:
(insn/f 230 229 231 (nil) (parallel [
(set (reg/f:DI 7 rsp)
(plus:DI (reg/f:DI 7 rsp)
(const_int -2147483696 [0xffffffff7fffffd0])))
(clobber (reg:CC 17 flags))
(clobber (mem:BLK (scratch) [0 A8]))
]) -1 (nil)
(nil))
a.c:27: internal compiler error: in insn_default_length, at insn-attrtab.c:493
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/> for instructions.
$
$
$ cat a.c
//===============================================
#include <stdio.h>
#include <stdlib.h>
#define MEGA (1024UL*1024/8)
#define N 2048UL
// if the value of N is less than 2048, no compiler internal error.
// This compiler error can be avoided if the array double a[N][MEGA]
// is declared as static.
int main()
{
double a[N][MEGA];
long int i,j;
long int s;
for(i=0;i<N;i++)
for(j=0;j<MEGA;j++)
a[i][j]=i^j;
s=0;
for(i=0;i<N;i++)
for(j=0;j<MEGA;j++)
{
if(a[i][j]!=(i^j)) {
fprintf(stderr,"Error a[i][j]!=i^j.\n");
exit(2);
}
s+=a[i][j];
}
return 0;
}
//===============================================
$ exit
exit
Script done on Sun 11 Jan 2004 07:59:41 PM EST
More information about the Gcc-bugs
mailing list