2 Replies Latest reply on Apr 8, 2013 12:50 AM by himanshu.gautam

    Bug with while(a && b) statements

    vmiura

      Hello,

       

      I'm getting a bug on GCN series in a statement of the following format:

       

      int ti = (some vector var)

      int cont = true;

       

      while(ti >=0 && cont)
      {

         cont = false;

         if(some conditions)

         {

            ti = (some vector var);

            cont = true;
        }

      }

       

      // If I change the code as follows then it works OK, pointing to some problem handling compound conditionals in a while() statement.

       

      int ti = (some vector var)

      int cont = true;

      int tcond = (ti >= 0 && cont);

       

      while(tcond)
      {

        cont = false;

        if(some conditions)

        {

           ti = (some vector var);

           cont = true;
        }

        tcond = (ti >= 0 && cont);

      }