SPNU151W January 1998 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
You control the output of the interlist feature when compiling with optimization (the --opt_level=n or -On option) with the --optimizer_interlist and --c_src_interlist options.
When you use the --optimizer_interlist option with optimization, the interlist feature does not run as a separate pass. Instead, the compiler inserts comments into the code, indicating how the compiler has rearranged and optimized the code. These comments appear in the assembly language file as comments starting with ;**. The C/C++ source code is not interlisted, unless you use the --c_src_interlist option also.
The interlist feature can affect optimized code because it might prevent some optimization from crossing C/C++ statement boundaries. Optimization makes normal source interlisting impractical, because the compiler extensively rearranges your program. Therefore, when you use the --optimizer_interlist option, the compiler writes reconstructed C/C++ statements.
When you use the --c_src_interlist and --optimizer_interlist options with optimization, the compiler inserts its comments and the interlist feature runs before the assembler, merging the original C/C++ source into the assembly file.
For example, suppose the following C code is compiled with optimization (--opt_level=2) and --optimizer_interlist options:
int copy (char *str, const char *s, int n)
{
int i;
for (i = 0; i < n; i ++)
*str++ = *s++;
}
The assembly file contains compiler comments interlisted with assembly code.
_main:
STMFD SP!, {LR}
;** 5----------------------- printf("Hello, world\n");
ADR A1, SL1
BL _printf
;** 6----------------------- return 0;
MOV A1, #0
LDMFD SP!, {PC}
If you add the --c_src_interlist option (compile with --opt_level=2, --c_src_interlist, and --optimizer_interlist), the assembly file contains compiler comments and C source interlisted with assembly code.
_main:
STMFD SP!, {LR}
;** 5----------------------- printf("Hello, world\n");
;------------------------------------------------------------------------------
; 5 | printf("Hello, world\n");
;------------------------------------------------------------------------------
ADR A1, SL1
BL _printf
;** 6----------------------- return 0;
;------------------------------------------------------------------------------
; 6 | return 0;
;------------------------------------------------------------------------------
MOV A1, #0
LDMFD SP!, {PC}