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.

CCS 4.0 could not set the optimization level to 2 or 3

I tried to optimize my code in CCS 4.0 because the speed of the non-optimized one is slower than my CCS3.3 version. However, after I set the optimization level to 3 in the C/C++Build->Tool Settings ->Basic Options , during the Building procedure, the CCS4.0 was just stuck there and it never ended. I Open the details in the progress dialog and here is the screenshot.

 When I choose canceling the process, here is red-color feedback in the console window in the following.

 INTERNAL ERROR: C:\Program Files\Texas Instruments\ccsv4\tools\compiler\c6000\bin\opt6x.exe experienced a fatal internal fault while
                processing function _envelop_log_tight_loop file C:\\DOCUME~1\\FYang\\LOCALS~1\\Temp\\049283

This is a serious problem.  Please contact Customer
Support with this message and a copy of the input file
and help us to continue to make the tools more robust.

Terminate batch job (Y/N)?
^C^C^C^CC:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [src/envelop_log/envelop_log.obj] Error -1073741510
"C:\Program: Interrupt/Exception caught (code = 0xc0000005, addr = 0x4158e9)

Build error
(Command canceled)

Can anyone give me some help on this?

  • Such internal errors are usually the result of a bug in the tools, in this case the optimizer (opt6x.exe). Could you confirm if you are using v6.1.9 of the C6x compiler tools? You can check this under Project Properties->CCS Build Settings.

    If it is v6.1.9 you may want to try downloading v6.1.11 from the Update Advisor web site and see if the error still occurs, as the bug may be fixed in this version. Please check this page for steps on how to set up CCS v4 to recognize and use a different version of compiler tools: http://tiexpressdsp.com/index.php/Compiler_Installation_and_Selection

    If the error still occurs with 6.1.11, please zip up your project and upload the file to your forum Profile and update this post to let us know its there, or send the zip file to support@ti.com so the bug can be tracked and fixed.

  • Thank you, Aarti.

    First of all, I was trying to compile my project with CGT v6.19 under CCS4.0.

    Then I downloaded the 6.1.11 and suddenly, my project can be compiled. This really makes me feel better. The major building optimziation settings include optimizaton level - 3 and optimization for speed - 5.

    After I built the project and I run the project on C6455 DSK board. The running results are all correct and they are the same as I got in CCS3.3. However, I found the running time is longer. The running time in CCS3.3 was 6.5797ms and in CCS4.0 was 7.8361ms. This is about 20% slower. I am just wondering if I should turn on some other optimization options so that I can acheive the similar performance as I got in CCS3.3.

     

  • It sounds like you are already using the max speed optimization level, in addition to -o3, so looks like you have the right options.

    It is possible for different versions of the compiler tools to generate executables with slightly differing code size/execution speed, since bug fix modifications could effect such factors. 

    Which version of compiler tools were used to build the project in CCS 3.3? You can use the same version of compiler tools with CCS v4 if you wish, although it may not be the latest.  Just use the process described in the wiki link provided earlier to point to any version of compiler tools you wish.

  • I was using CGT6.1.5 and even older. In CCS 3.3, these CGT work fine.

    However, in CCS4, the building procedure stalled in the middle if I choose these optimization level and these CGT, which was reported in this thread early. That is why I have to use CGT6.1.11 so that I can finish the compiling and get the project built.

  • Renaissance,

    As discussed, Aarti has your project now and will be looking into this. Here is an update on findings so far. Thank you for confirming that your original project was with CGT 6.0.8.

    The source file that hangs during compile is envelop_log.c when built with –o2 or –o3. I compiled just this one file on command line and can reproduce the internal error for CGT 6.1.9, 6.1.5, 6.1.3, 6.1.2.

     It shouldn’t matter whether it is CCS 3.3 or CCS 4 used to do the build. The build does complete with all the above versions if –o1 or lower is used.

    I also verified that it does build fine with 6.1.11 with –o2 and –o3 as reported. I need to track down a 6455 board to run the code to compare the cycle time. There were likely some changes in 6.1.x that might be affecting the performance of some routines.

    Best Regards,

    Aaron

  • We have seen the –mf5 option generating “invalid compiler option” on other ISAs. This is possibly due to a bug in the BTI (build tool interface). The –mf5 option was getting split into –mf and –m5 which are not valid options, hence the warning. A workaround is to manually add --opt_for_speed=5 instead of –mf5 in the build window.

    This should not be an issue in CCS v4 though. Please try CGT 6.0.8 in CCS v4 and let us know the result.

    Thanks,

    Aaron

  • Thanks, Aaron.

    Using CGT 6.0.8 in CCS4.0, it works. My project can be built successfuly in this configuration and also the running time is consistent with what I got using CGT6.0.8 and CCS3.3.  As I mentioned early, for this project, there was 20% running time difference (CGT6.0.8 is faster) if I compile my project using CGT6.1.11 and CCS4.0.  Since the running results are all the same, I think using CGT6.0.8 is a better solution for me.

    In order to further confirm this change, I use the setting 1 CGT 6.0.8 in CCS4.0 and setting 2 CGT6.1.11 and CCS4.0 on another project. For this project, I do not see too much difference in the running time and the difference is around 1.5% (CGT6.0.8 is faster). 

    Based on above comparison, the old CGT 6.0.8 works better in CCS4.0

  • This wiki article http://tiexpressdsp.com/index.php/C6000_v6.1_Compiler_Performance talks about what to do if the performance of code generated by v6.1.X tools is not as good as what you saw with v6.0.X tools.

    Thanks and regards,

    -George