Internal compiler errors in 991208 snapshot

James A. Bednar jbednar@cs.utexas.edu
Thu Dec 9 22:16:00 GMT 1999


The 991208 snapshot encounters an internal error when compiling both
of the attached files (identical except for one line) on a 600Mhz
Pentium III running Red Hat Linux 6.0 (kernel 2.2.12-25):

  pale:~/src> /usr/local/bin/g++ -v
  Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
  gcc version 2.96 19991208 (experimental)

  pale:~/src> /usr/local/bin/g++ -c -O internalerror1.c
  internalerror1.c: In function `int cmd_connection_statistics (int, const char **)':
  internalerror1.c:146: Internal compiler error.
  internalerror1.c:146: Please submit a full bug report.
  internalerror1.c:146: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.

  pale:~/src> /usr/local/bin/g++ -c -O internalerror2.c
  internalerror2.c: In function `int cmd_spatial_contrast (int, const char **)':
  internalerror2.c:99: Internal compiler error.
  internalerror2.c:99: Please submit a full bug report.
  internalerror2.c:99: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.

The same code compiles fine under the gcc 2.95.1 19990816/Linux and
earlier releases, and also works if optimization is turned off.

Thanks,

Jim Bednar


-------internalerror1.c---------------------------------------------------------
typedef struct
{
  int centerx, centery;
  float (*weights)[13][13];
  float *lat_exc_wts;
  float *lat_inh_wts;
} Neuron;

extern Neuron cortex_map[32][32];

extern int    num_eyes;

void   initialize_actlists(void);
void   initialize_markers(void);

extern double input_vectors[36*36*2];

extern int inh_array_width;
extern int inh_rad;
extern int N;
extern int nrows;
extern int or_num_angles;
extern int rf_radius;
extern int RN;
extern int tsettle;

extern int    or_pref[31][32][32];
extern double or_select[31][32][32];


#define NSELECTIVITIES  10
#define NUM_BUBBLE_AREAS 2


typedef struct
{
  double value;
  int count;
}Histo;


int cmd_spatial_contrast( int argc, const char *argv[] )
{
  double inp_resp[31][32][32];              /* To calculate inp_resp */
  int x, y, c, sp, i, j, k, l, eye, row;
  double xsq, ysq, sigmax, contrast;
  int ts, lowk, lowl, highk, highl;

  const int    ui            = 2;
  const int    uj            = 2;
  const int    ncontrasts    = 4;
  const int    nfrequencies  = 1;
  const double max_contrast  = 1;
  const double max_spfreq    = 2;
  const int    pe            = 1;
  const int    therow        = 1;

  int peak_k = 0;
  int peak_l = 0;
  double joe=0.3;
  
  joe = (double)rf_radius;

  for (sp=1; sp <= nfrequencies; sp++){
    joe = (double)sp/(double)nfrequencies * max_spfreq;
    {  /* The PE of the neuron */
    
      lowk = 0;
      highk= 35;
      lowl = 0;
      highl= 35;
	
      /* Now, generate gaussian input centered on this peak. Subtract 0.5 */
      for (x=0; x<RN; x++)
	for (y=0; y<RN; y++){
	  double value;
	  xsq = (double)(x-peak_k); xsq *= xsq;
	  ysq = (double)(y-peak_l); xsq *= xsq;
	  value = -((xsq+ysq)/(joe*joe)) - 0.5;
	  for (eye=0; eye<num_eyes; eye++)
	    input_vectors[(((eye)*(RN*RN)+(x)*(RN))+(y))] = value;
	}
    }
  
    for (c=1; c<=ncontrasts; c++){
      contrast = (double)c/(double)ncontrasts * max_contrast;
      for(i=0; i<nrows; i++){  /* Add up input and lateral activations. */
	row = i;
	for(j=0; j<N; j++);
      }
      /* Repeat the code in settle_responses here to calculate response */
      initialize_markers();
      initialize_actlists();
      for (ts=1; ts<=tsettle; ts++);
    }
  }

  return 0;
}



int cmd_connection_statistics( int argc, const char *argv[] )
{
  /* Part of the net to collect statistics from. 
   * Only corresponding PEs are used. */
  const int nODvalues      = 10;
  const int low_index      = (argc>2 ? 1 :   0);
  const int high_index     = N-1;

  int i,j,pe,k,l,m,eye;
  int bubble_rad;
  double max_or_select, max_od, or_division;

  Histo add_histo[NSELECTIVITIES][NUM_BUBBLE_AREAS][36][36];

  for(i=0; i<nrows; i++){
    const int row = i;
    
    for(m=0; m<NSELECTIVITIES; m++)   /* Initialize the array for each row*/
      for(j=0; j< NUM_BUBBLE_AREAS; j++)
	for(k=0; k< or_num_angles; k++)
	  for(l=0; l< or_num_angles; l++){
	  }
    if ((row>=low_index) && (row<=high_index))
      for(j=low_index; j<=high_index; j++){
	const int lowk  = low_index ;
	const int highk = high_index;
	const int lowl  = low_index ;
	const int highl = high_index;
	const int select_index = 3;
	const int angle_ij     = 5;

	for(k=lowk; k<=highk; k++)
	  for(l=lowl; l<=highl; l++){
	    const int angle_kl = 7;
	    const int bubble_index = ( (((k-row) <= 2) && (abs(l-j) <= bubble_rad)) ? 0 : 1);
	     
	    add_histo[select_index][bubble_index][angle_ij][angle_kl].value+=
	      cortex_map[row][j].lat_inh_wts[row+j*k*l+inh_rad+inh_array_width];
	  }
      }
  }
  
  return 0;
}

-------internalerror2.c---------------------------------------------------------
typedef struct
{
  int centerx, centery;
  float (*weights)[13][13];
  float *lat_exc_wts;
  float *lat_inh_wts;
} Neuron;

extern Neuron cortex_map[32][32];

#define       num_eyes 2

void   initialize_actlists(void);
void   initialize_markers(void);

extern double input_vectors[36*36*2];

extern int inh_array_width;
extern int inh_rad;
extern int N;
extern int nrows;
extern int or_num_angles;
extern int rf_radius;
extern int RN;
extern int tsettle;

extern int    or_pref[31][32][32];
extern double or_select[31][32][32];


#define NSELECTIVITIES  10
#define NUM_BUBBLE_AREAS 2


typedef struct
{
  double value;
  int count;
}Histo;


int cmd_spatial_contrast( int argc, const char *argv[] )
{
  double inp_resp[31][32][32];              /* To calculate inp_resp */
  int x, y, c, sp, i, j, k, l, eye, row;
  double xsq, ysq, sigmax, contrast;
  int ts, lowk, lowl, highk, highl;

  const int    ui            = 2;
  const int    uj            = 2;
  const int    ncontrasts    = 4;
  const int    nfrequencies  = 1;
  const double max_contrast  = 1;
  const double max_spfreq    = 2;
  const int    pe            = 1;
  const int    therow        = 1;

  int peak_k = 0;
  int peak_l = 0;
  double joe=0.3;
  
  joe = (double)rf_radius;

  for (sp=1; sp <= nfrequencies; sp++){
    joe = (double)sp/(double)nfrequencies * max_spfreq;
    {  /* The PE of the neuron */
    
      lowk = 0;
      highk= 35;
      lowl = 0;
      highl= 35;
	
      /* Now, generate gaussian input centered on this peak. Subtract 0.5 */
      for (x=0; x<RN; x++)
	for (y=0; y<RN; y++){
	  double value;
	  xsq = (double)(x-peak_k); xsq *= xsq;
	  ysq = (double)(y-peak_l); xsq *= xsq;
	  value = -((xsq+ysq)/(joe*joe)) - 0.5;
	  for (eye=0; eye<num_eyes; eye++)
	    input_vectors[(((eye)*(RN*RN)+(x)*(RN))+(y))] = value;
	}
    }
  
    for (c=1; c<=ncontrasts; c++){
      contrast = (double)c/(double)ncontrasts * max_contrast;
      for(i=0; i<nrows; i++){  /* Add up input and lateral activations. */
	row = i;
	for(j=0; j<N; j++);
      }
      /* Repeat the code in settle_responses here to calculate response */
      initialize_markers();
      initialize_actlists();
      for (ts=1; ts<=tsettle; ts++);
    }
  }

  return 0;
}



int cmd_connection_statistics( int argc, const char *argv[] )
{
  /* Part of the net to collect statistics from. 
   * Only corresponding PEs are used. */
  const int nODvalues      = 10;
  const int low_index      = (argc>2 ? 1 :   0);
  const int high_index     = N-1;

  int i,j,pe,k,l,m,eye;
  int bubble_rad;
  double max_or_select, max_od, or_division;

  Histo add_histo[NSELECTIVITIES][NUM_BUBBLE_AREAS][36][36];

  for(i=0; i<nrows; i++){
    const int row = i;
    
    for(m=0; m<NSELECTIVITIES; m++)   /* Initialize the array for each row*/
      for(j=0; j< NUM_BUBBLE_AREAS; j++)
	for(k=0; k< or_num_angles; k++)
	  for(l=0; l< or_num_angles; l++){
	  }
    if ((row>=low_index) && (row<=high_index))
      for(j=low_index; j<=high_index; j++){
	const int lowk  = low_index ;
	const int highk = high_index;
	const int lowl  = low_index ;
	const int highl = high_index;
	const int select_index = 3;
	const int angle_ij     = 5;

	for(k=lowk; k<=highk; k++)
	  for(l=lowl; l<=highl; l++){
	    const int angle_kl = 7;
	    const int bubble_index = ( (((k-row) <= 2) && (abs(l-j) <= bubble_rad)) ? 0 : 1);
	     
	    add_histo[select_index][bubble_index][angle_ij][angle_kl].value+=
	      cortex_map[row][j].lat_inh_wts[row+j*k*l+inh_rad+inh_array_width];
	  }
      }
  }
  
  return 0;
}



More information about the Gcc-bugs mailing list