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 Compiler 7.3.7 / Code Generated Is Different Sometimes

In my business, it is important to be able to recreate a binary object image at will. We "proof" this by generating a "build" of the source code using a configured version of the compiler, copying the source code to another directory, and then compiling it again. After this process is complete, it is expected that the loadable object image is bit for bit identical.

Generally, using Code Composer 4, and the C6000 series compiler (which supports the C6748 DSP), that is true. The compiler generates identical instruction streams and the final output is identical. However, I've come across a case where the compiler seemingly randomly generates a "different" instruction stream. The source file is not changed, nor is the Windows XP computer changed, nor is the logon account changed, nor is the version of Code Composer changed.

The only change is to make a copy and recompile everything.

The assembler output produced by the compiler does not match in a very specific area of the generated assembly code, and appears to be related to the use of C++ template functions. There' s no logical or rational reason why this localized stream area should be different, so far as I can tell. No other source file produces different assembler instructions. I've come to the conclusion that this must be a characteristic (perhaps an error) in the compiler itself that should be fixed.

Has anyone else found a similar problem? For the TI support staff, I can forward to you this file so you can try this on your own system.

  • Timothy Frank said:
    For the TI support staff, I can forward to you this file so you can try this on your own system.

    Please submit a test case as described in the last part of the forum guidelines.

    A related note ... The utility objdiff in the cg_xml package can be used to compare executables, object files, and libraries.

    Thanks and regards,

    -George

  • Any input to this question? I’ve a costumer with the same behavior and the same problem.  

    /Stefan

  • We never received a test case.  Without that, there is nothing we can do.

    Thanks and regards,

    -George

  • Hi George - thanks for reminder. I'll read through your recommended submittal and attempt to find the source code "difference" so you can ponder.

  • I'm off on another program at the moment. I traced this problem to the feature of the C++ language known as "explicit template instantiation" ... whereby the programmer has placed a templatized function or classs into a library. Without the explicit template instantiation, the linker will remove the template function or class as an "unreferenced" object. Thus, at final link, the application link phase will flag with an unresolved external reference error. For some reason, the code associated with the explicit template instantiation is slightly modified by the compiler depending on (factors I don't know and haven't determined) even though everything else is the same including the source code directory etc.

    I can send you only that file, showing the assembly code differences. It may take awhile longer, as I'm away at this time on another project. Will try to do this when I return.

  • HI,

    => "I can send you only that file, showing the assembly code differences"

    Yes, please! when you have the time..

    /Stefan

  • Hello again. Let's close this one out for now. It's real, etc, ... however, the project isn't in active development. When it returns to active development, and should this issue re-appear, and given the changes to CCS V4 to V5 that we will entertain, etc, I'll repost. I did peruse my old directory archives, but didn't find the evidence you need.