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.

Compiler/TMS570LC4357: Optimization levels and options description

Part Number: TMS570LC4357


Tool/software: TI C/C++ Compiler

Hello,

We are developing safety critical software and we come to the phase when we would like to use optimizations.

Is there detailed specification of optimizations levels (-On) in order to know which individual compiler options are used?

We want to use -O2 but after compilation our code functionality is broken. Do some compiler options require code to be written some specific way?

Since we develop safety critical software, we need to clearly understand how each compiler option works and its specific requirements.

We are using following tool-chain with target procesor version set as 7R5:

  • Hello,

    Please review the TI ARM compiler users' guide: SPNU151 ()

    Chapter 3 describes the optimizations used for different settings.

  • Thanks for your fast reply,

    Unfortunately SPNU151 doesn't cover optimization to extent we need.

    We need to decompose each optimization option (-On) to individual flags (options) and to basically drive optimization by ourselves.

    I'm looking for something like this document: Options That Control Optimization

    Thanks for your help

  • Thanks for the clarification. I will ask someone from our ARM compiler team to comment on this thread.

  • Marek Absolon said:

    We need to decompose each optimization option (-On) to individual flags (options) and to basically drive optimization by ourselves.

    I'm looking for something like this document: Options That Control Optimization

    Unfortunately, our documentation is not organized in that manner.  Our best documentation on this topic was pointed out by Sunil in his first post.

    Thanks and regards,

    -George

  • I understand that there is no documentation as in my example, but isn't there any way how to find out how to decompose each option to its elemental flags or functionality that would tell us more information? Just like GCC works with using options "-Q --help=optimizer".

    Any way how to prove what is happening during optimization would help us.

    Thanks and regards,

    Marek

  • Marek Absolon said:
    isn't there any way how to find out how to decompose each option to its elemental flags or functionality

    Unfortunately, Chapter 3 of the TI ARM compiler manual is the best solution we have available.

    Thanks and regards,

    -George

  • If I understand your reply correctly, there is absolutely no way how to drive optimizations other then using --opt_level, -On and --opt_for_speed.

    For example I cannot disable only simplification of expressions and statements optimization functionality mentioned in SPNU151 under --opt_level=0 (-O0) (and keep all other optimizations under this option) and there is no documentation of coding standards or proof of this operation validity that would verify correctness of expressions that will be optimized.

    I'm I correct?

    Thanks and regards,

    Marek

  • Marek Absolon said:
    If I understand your reply correctly, there is absolutely no way how to drive optimizations other then using --opt_level, -On and --opt_for_speed.

    Note -On or -on is a short form equivalent for --opt_level=n.  That option, and --opt_for_speed, are the main options that influence optimization.  There are a few other options, which are more specific in their effect.  Please search the ARM compiler manual for the table titled Advanced Optimization Options.

    Marek Absolon said:
    I cannot disable only simplification of expressions and statements optimization functionality mentioned in SPNU151 under --opt_level=0 (-O0) (and keep all other optimizations under this option)

    Correct.

    Marek Absolon said:
    there is no documentation of coding standards or proof of this operation validity that would verify correctness of expressions that will be optimized.

    We have no documentation which covers those details in that manner.  However, another way to approach this issue is with the SafeTI™ Compiler Qualification Kit.

    Thanks and regards,

    -George