gcc-2.95pre: Virtual array reg_single_usage element 184 out of bounds, at ../../../egcsm/gcc/loop.c:6902

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Sat May 22 07:16:00 GMT 1999


Hi,

gcc-2.95pre on powerpc-linux-gnu produces this error message:

decode.c:42: Virtual array reg_single_usage element 184 out of bounds, at ../../../egcsm/gcc/loop.c:6902

for the appended testcase, derived from code in mpg123. Compilation with -O2 is
enough to trigger the bug. Out of the RH-6.0 suite bind, mpg123, taper and xntp3
caused this bug to happen.

Franz.


extern float  decwin[512+32];

int synth_1to1(float  *bandPtr,int channel,unsigned char *out,int *pnt)
{
  static const int step = 2;
  short *samples = (short *) (out+*pnt);

  float  *b0;
  int clip = 0; 
  int bo1;

  {
    register int j;
    float  *window = decwin + 16 - bo1;
    for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step)
    {
      float  sum;
      sum = -*(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;
      sum -= *(--window) * *b0++;

      if( ( sum ) > 32767.0) { *( samples ) = 0x7fff; ( clip )++; } else if( ( sum ) < -32768.0) { *( samples ) = -0x8000; ( clip )++; } else { *( samples ) =  sum ; } ;
    }
  }

  *pnt += 128;

  return clip;
}




More information about the Gcc-bugs mailing list