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.

C66x compiler option -O0 has no effect

Hi All,

    It doesn't appear that the -O0 compiler option is being used by the compiler. Here is a command line and and the header of the corresponding assembler listing:

The header of the assembler listing is:

The optimization level is still -O2. The result is the same with the full option: --opt_level=0.

Thanks,

Mark Brown

  • Note the "-o" later in the command line.  -o is equivalent to -o2 and because it occurs after the -o0 it overrides it, thus you end up with level 2 optimization.

     

  • Paul,

       I've always seen this as a standard option that specifies the output file of the compiler (object or executable). In fact the cl6x compiler manual says the following:

    Page 31

    There is no other description for this option for the non-linker (-c) case. Having the same option mean two different things is very confusing and prone to unexpected behavior such as this. Not a happy camper... :(

    Thanks,

    Mark Brown

  • The non-linker case appears in both Table 2-1 (Basic Options) and Table 2-10 (Optimization Options) but is shown using an upper-case "O".  The lower-case form is a deprecated spelling that is still accepted.  This would be a bit hard to discover since the start of section 2.3 says "Options are case sensitive".

    An important issue here is the distinction between compiler and link options and that they cannot be mixed, thus the need for the --run_linker (-z) option on the command line.  I haven't looked but I would not be surprised if there are other short alias forms that overlap between compiler and linker.  The full option names do not have this problem.