AnsweredAssumed Answered

Decrement Loop doesn't work correctly.

Question asked by genchan on Mar 6, 2013
Latest reply on Mar 12, 2013 by himanshu.gautam



I made a program including loop which calls a simple function.


I had made it with "decrement" loop at first, but it didn't work correctly.

I remade it with "increment" loop, it worked.

I think this is a bug of optimizer.


Sample of bad case is here:


void Replace( unsigned short a[], unsigned short To, unsigned short From  )


   // simple load, and, not and, or, store procedures.



void Sample( __local unsigned short img[128*128] )


unsigned short L[64]; unsigned short R[64];


// after initialization of L, R.....

unsigned int m;

for( m=63; m<64; --m ){     // <- This is the point. An increment loop works correctly.

     unsigned short To = L[m];

     unsigned short From = R[m];

     if( From == To || !From || !To ){ continue; }


     // some function calls......


     Replace( R, To, From );


     // subsequent processes.....




My environment:

     Driver Package: 9.012-121219a-152192C-ATI

     Catalyst Version: 13.1

     Radeon HD 7970