Assignment to boolean vector elements may not be applied before conversion to vpred

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-13914
    • Hide
      C7000_1.4.0.LTS
      C7000_2.1.0.LTS
      C7000_5.0.0.LTS
      C7000_3.1.0.LTS
      C7000_4.1.0.LTS
      Show
      C7000_1.4.0.LTS C7000_2.1.0.LTS C7000_5.0.0.LTS C7000_3.1.0.LTS C7000_4.1.0.LTS
    • Hide
      C7000_6.1.0.STS
      C7000_4.1.2.LTS
      C7000_5.0.1.LTS
      Show
      C7000_6.1.0.STS C7000_4.1.2.LTS C7000_5.0.1.LTS
    • default
    • Reduce the optimization level to -o1 or below. Alternatively, affected code can be rewritten to only use __vpred types and not boolean vector types.

      An assignment to a boolean vector element may in some cases not be applied before conversion to a __vpred. An example of affected code is below:

      int32_t test_function(void *dst1)
      {
        __vpred *pvPred = (__vpred *)dst1;
        bool_vec vpred_bool = bool_vec(0);
      
        // These writes
        for (uint32_t loc = 0; loc < __C7X_VEC_SIZE_BYTES__/4; loc++)
        {
          vpred_bool.s[loc*4]     = true;
          vpred_bool.s[loc*4 + 1] = true;
          vpred_bool.s[loc*4 + 2] = true;
          vpred_bool.s[loc*4 + 3] = true;
        }
      
        // Are not correctly applied to *pvPred
        *pvPred = __create_vpred(vpred_bool);
        uint64_t vpred_as_uint64 = 0;
        memcpy(&vpred_as_uint64, dst1, sizeof(__vpred) < sizeof(uint64_t) ? sizeof(__vpred) : sizeof(uint64_t));
        // Expect to see something non-zero like "18446744073709551615", but "0" is seen instead
        printf("pvPred: %llu\n", vpred_as_uint64);
        return 0;
      }

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5553 - Assignment to boolean vector elemen...
                SYNCHRONIZED
                • Last Sync Date: