This is the mail archive of the gcc@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]

bugs in double dimension arrays optimization


Hello i figured out where my program crashes if i
use the latest snapshot:

#define white 0
#define black 1

typedef {
  ..
  int stuklijst[2][16];
  ..
} Game;

Game *partij;
int PieceList[2][32];
int pieceid[64];

// *partij has its allocated memory in shared memory.

  ..
  for( i = white ; i <= black ; i++ ) {

    ..code..

    for( j = 0 ; j < 16 ; j++ ) {
      PieceList[i][j] = partij->stuklijst[i][j];  <== this line it crashes
      pieceid[PieceList[i][j]] = id2index[j];
    }
    ..
  }

If i shuffle the code inside the 'i' loop
then code also crashes.

As soon as i put a 'printf' inside the 'i', then
it doesn't crash there. 

Note that i is getting used over
and over again in all kind of loops.

Compilerflags: -g -O2

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