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.

Why does "restrict " qualifier seem to cause "cannot load from non-primitive location" error in watch window?

 

I have a routine called MakeSandwiches() called by a dma_rx ISR.

The function declares its own local pointers to things:

float * pPeanut, pButter, pJelly;

and also some other "restricted" pointers:

float * restrict pKnife;

float * restrict pSpoon;

float * restrict pPlate;

that point to specific, unique locations in the code. The restrict qualifier is used to make sandwiches faster :)

When stepping in, seems like pPeanut, pButter, pJelly are displayed fine in the watch window, but for some strange reason, pKnife, pSpoon, pPlate display the "cannot load from non-primitive location" error in the watch window.

I've read other posts here about having to cast user-defined types explicitly so that the compiler displays these expressions correctly in the watch window. But what is so complicated about a float * restrict?

 

Any clues?

 

--Dave

 

  • I am using CCSv4 BTW. Didn't seem to have this problem in CCS 3.3 ... I think.

  • Dave,

    I believe you have run into a CCS bug. I found an internal bug report describing a similar issue . Could you clarify which device you are building code for (c64x+, c66x etc), and if the --abi=eabi option is enabled in the compiler options? If so, I believe it is related to the same issue.

    This bug is fixed in CCS 5.1, so you can download the latest build of CCS 5.1M7 from this wiki page and give it a try with your project. If the issue you are seeing is indeed the same bug, it should be fixed in CCS 5.1.

  • Hi Aarti,

    Thanks for replying. I am targetting a c67x+ device. At some point I was using --abi=eabi, but looks like I am not anymore. Could it still be the same issue or a variant of it? Aside from CCS 5.1, what else can I try?

  • My understanding is the known bug is related to EABI. We would need a test case to confirm whether what you are seeing (without EABI enabled) is related to the same bug or not. I'll try to create a test case and see if I can reproduce it without EABI enabled. If you can provide a simple test case that can be used to reproduce the issue, that would speed things up as well.

  • Dave,

    I tried duplicating this and I only see the issue when building for EABI, not legacy COFF. I built the same project with just this one option modified. In the EABI build, the variables with restrict qualifier give the message "cannot load from non-primitive location" in the watch view, while in the legacy COFF build, they are displayed properly.

    Could you re-check the settings on your project? And if you are indeed building for non-EABI, could you please provide us a test project?

  • Hi, sorry it took so long to reply. I finally stumbled upon a .cmd file that was being used to specify --abi=eabi in my project. :(

    --Dave