This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug (?) with code
- From: Martin Vogt <m_vogt at informatik dot uni-kl dot de>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 10 May 2003 13:39:37 +0200
- Subject: Bug (?) with code
Hello,
I dont know if its a gcc bug, or an expected behaviour.
At least the program segfaults on
gcc 3.3 (SuSe 8.2) gcc 2.95.3 (SuSe 8.1)
and gcc 2.7.2 (unknown)
#define MAX 11000
double A[MAX][MAX];
int main(int ac, char **av){
A[0][0]=1;
A[MAX-1][MAX-1]=1;
printf("Hello MAX=%d\n",MAX*MAX*8);
getchar();
return 0;
}
You need enough swap, but the machines all have 4GB swap
and the allocatec matrix only uses 800 MB.
If you set MAX to 10000 it works (on machines with enough swap)
with 11000 it segfaults.
regards,
Martin