This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6000-CGT: Faulty code generation when using variable reference

Part Number: C6000-CGT

Hello TI!
We have found a bug where the compiler generates faulty code if variable reference is used. See code snippet bellow.

const KeyValuePair<T, u32> pair = pairs[i];
const KeyValuePair<T, u32>& pair = pairs[i];


Note that these code snippet is inside a loop over pairs.

I have successfully generated Compiler Test Case for this issue but I would like to send it as a private message.

Regards,
Enver

  • Please describe ...

    Enver Sultanov said:
    a bug where the compiler generates faulty code if variable reference is used

    ... in more detail.  How do you know the code is faulty?  Exactly what do you look at?  What result do you expect, and what do you get instead?

    For the source file that contains the problem code snippet, please follow the directions in the article How to Submit a Compiler Test Case.  Regarding this test case you say ...

    Enver Sultanov said:
    I would like to send it as a private message

    I understand.  Search How to Submit a Compiler Test Case for the part titled Protecting Intellectual Property.  Use those directions to privately submit the test case to me.

    Thanks and regards,

    -George

  • se::MajorityFilter<se::u64, 16> b;
     // WHEN
     b.reset();
     b.add(8);
     b.add(8);
     b.add(10);
     b.add(2);
     // THEN
     se::u64 c = b.get();
     std::cout << c << "\n";
     assert(c == 8);


    Here is a code snippet where we have a template class called MajorityFilter which in this case can
    store a number of u64:s and return the value with the highest count. The result from the code snippet
    is 32, I expect it to be 8. Worth mentioning is that the MajorityFilter is a FIFO queue.

    I have sent the compiler test case in a private message.

    Btw the behavior is as I expect it to be when built with compiler option -g instead of
    -O3 --opt_for_speed=4 -DNDEBUG --symdebug:none .

    We are using C6000-CGT-8.3.8

    Regards,
    Enver

  • Thank you for notifying us of this problem, and for submitting a test case through private messaging.  I am able to reproduce the same behavior.  I filed the issue CODEGEN-8579 to have this investigated.  Normally, I would supply a link that would allow you to follow the issue.  However, in this case, I understand so little about the cause of the problem, the description of the issue is very vague.  While the issue is in that state, I don't want other customers to get confused by it.  After the bug is better characterized, it will be published.  Then I'll get you the link.

    Thanks and regards,

    -George