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.

CCSV3.3 Macro problem, Invalid I-code record

Other Parts Discussed in Thread: OMAP-L137

Using CCS V3.3.81.11 and building some borrowed Linux include files that I am porting to the OMAP-L137.  Works fine with gcc, OMAP35X and beagleboard builds.  Below macro causes internal compile error.  Only solution thus far is to not make it a macro.

#define CIRC_CNT_TO_END(head,tail,size) \
 ({int end = (size) - (tail); \
   int n = ((head) + end) & ((size)-1); \
   n < end ? n : end;})

Following line in C++ routine fails:

int endCount;

endCount =  CIRC_CNT_TO_END(recv->head,recv->tail,recv->size);

Get: 
INTERNAL ERROR: Invalid I-code record, aborting

Following line works fine if don't reference Macro but does same thing:

   int end = (recv->size) - (recv->tail);
   int n = ((recv->head) + end) & ((recv->size)-1);
   endCount = n < end ? n : end;

Kev


 

  • Sounds like this could be a bug in the compiler. Which version of compiler tools are you using? The CCS Help About menu should tell you the version being used.

    It would help if you could attach the complete C source file (you can attach it under your Profile on the forums) and any specific build options used, so we can duplicate the error and address it for a future release if confirmed to be a bug in the compiler.

  • Sorry, thought I had included the version but just noticed I did not.  TMS470 Code Generation Tools V4.4.12.  Studio version is V3.3.81.11.

    If you just include the macro I referenced into any C++ code it should fail.

    Kev

     

  • I am still unable to reproduce the Invalid I-code error. I must be missing something in the code that is triggering the error.

    Instead I am getting a different error when defining and using the macro as you have indicated, compiler gives me an error: "expected an expression" at the line where it is being invoked.