------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-30 
03:30 -------
And here is the interesting part, PRE does not move a redundant expression out 
of a loop (well it does 
but it is only out of the inner most loop).

Confirmed, reduced testcase, doing -fno-tree-PRE causes us not to create the 
infinite loop but that is 
because we are not pulling out the redundant expression out of the inner loop:
void FFT(int NumSamples, float *RealOut, float ar1)
{
  int i, j, n;
  int BlockSize, BlockEnd;
  if (NumSamples <= 1)
    __builtin_exit(1);

  i = 0;
  L1:
    RealOut[i] = (RealOut == 0) ? 0.0 : RealOut[i];
    i++;
  if (NumSamples <= i) goto L1;
  
  BlockEnd = 1;
  for (BlockSize = 2; BlockSize <= NumSamples; BlockSize *=2)
  {
    float cm1 = __builtin_cosf(-1.0);
    for (i = 0; i < NumSamples; i += BlockSize)
      for (j = i, n = 0; n < BlockEnd; j++, n++)
        RealOut[j] =  cm1 * ar1;
    BlockEnd = BlockSize;
  }
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-30 03:30:25
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19698

Reply via email to