This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]