Hi,
I'm debugging optimized code for a MSP430F2618 with MSPCGT v4.1.3 and CCSv5.3. Using compiler option -O3 the program passes all tests and works as expected.
Unfortunately I am not very successful with enabled link-time optimization (-O4) so far. With help of the debugger I've narrowed down the problem to only one function. If I open the disassembly view of the debugger it shows the function in question is inlined and more optimized. The map file confirmes that the symbol of that global function disappears.
I have enabled diagnostic messages, optimizer information files and assembler listings to understand how the compiler tries to optimze that part of my code. Looking at the generated *.asm or *.lst files the function is not inlined and there's still a call to that function present. The file-level analysis summary in the *.nfo file does not mark the function inlineable. ofd430 shows a reference to the function for the corresponding *.obj file.
My compiler flags are (without include search path):
-vmspx --abi=eabi --code_model=small --data_model=small -O4 --opt_for_speed=4 -g --optimize_with_debug=on --gen_acp_xref --gen_acp_raw --define=__MSP430F2618__ --diag_warning=225 --display_error_number --issue_remarks --optimizer_interlist --gen_opt_info=2 --printf_support=minimal -k --src_interlist --asm_listing --cross_reference
My linker flags are (without library search path):
-vmspx --abi=eabi --code_model=small --data_model=small -O4 --opt_for_speed=4 -g --optimize_with_debug=on --gen_acp_xref --gen_acp_raw --define=__MSP430F2618__ --diag_warning=225 --display_error_number --issue_remarks --optimizer_interlist --gen_opt_info=2 --printf_support=minimal -k --src_interlist --asm_listing --cross_reference -z --stack_size=80 -m"msp430f2618.map" --heap_size=0 --use_hw_mpy=16 --reread_libs --verbose_diagnostics --warn_sections --display_error_number --issue_remarks --rom_model
Am I fatally wrong? I have the strange feeling that my brain is probably still on vacation. Where do I find the resulting assembly listing files after link-time optimization? Is it possible to make the optimizer information file more garrulous for -O4?
Best regards,
Christian