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.

Impact of --src_interlist compiler option on Code with Optimization enabled

Other Parts Discussed in Thread: TMS320F28335

Hi,

I am using TMS320F28335 and I am trying to use --src_interlist compiler option. As per spru514C, for optimized code it says "If the optimizer is invoked (--opt_level=n option), optimizer comments are interlisted with the assembly language output of the compiler, which may rearrange code significantly."

Does it mean it will rearrange the code, which may impact the optimization.

As per link http://processors.wiki.ti.com/index.php/C28x_Code_Generation_Tips_and_Tricks it say, there is no impact on optimization.

My project should not have any level of optimization. So my main intention is to have --src_interlist compiler option and

  1. Generate .asm file without optimization.
  2. Generate the same .asm file with optimization.
  3. Compare both with and without optimization .asm files and try to change the code. 
  4. Finally to have an effective code without any optimization compiler options.

Thanks & Regards

Vishnu Beema

  • Vishnu Beema said:
    Does it mean it will rearrange the code, which may impact the optimization.

    No.  One of the side effects of optimizing C code is that the resulting assembly may do things in a different order than you might expect.  Presuming speed is important, then this is what you want.  Using --src_interlist does not impede such code re-arrangement.  Actually, it helps you to see it.

    The rest of your post confuses me.  At one point you say ...

    Vishnu Beema said:
    My project should not have any level of optimization.

    Then, later, you say you plan to ...

    Vishnu Beema said:
    Generate the same .asm file with optimization.

    I can't resolve those two statements.

    Thanks and regards,

    -George

  • Hello George,

    Thank you for your comments.

    Since my project should NOT have any optimization options (-O1, -O2, -O3 etc), my intentions is to first generate .asm files with optimization, then analyse the generated asm code (with -s compiler option, to understand asm file) and then remove the optimization option and then reorder/modify the code in such a way it will be similar to code generated with optimization (Its like reverse engineering).

    I am not sure, whether it a right approach, but i am trying to analyze the optimized code and then remove optimization option and try to write a better code (without optimization option). Please let me know if you need more clarity.

    Thanks & Regards

    Vishnu Beema