C2000 C/C++ Code Generation Tools v18.1.8.LTS Release Notes
Table of Contents
1 Support Information
1.1 List of Resolved and Known Defects
Resolved defects
| ID | Summary |
|---|---|
| CODEGEN-7146 | Compiler loses conversion to size_t in length argument to memcpy |
| CODEGEN-7141 | Simple division expression optimized into incorrect complicated expression |
| CODEGEN-7098 | Incorrect optimization of expression that mixes the types long and short |
| CODEGEN-7011 | Compiler intermittently fails with INTERNAL ERROR: opt2000 experienced a segmentation fault |
| CODEGEN-6911 | Floating point comparison that fits min/max-index pattern can produce incorrect code |
| CODEGEN-6783 | Ensure C std headers do not issue MISRA warnings |
| CODEGEN-6666 | 64-bit to 32-bit assignment with predecrement causes compiler crash with INTERNAL ERROR: no match for ASG |
| CODEGEN-6354 | C28 Compiler should emit performance advice 2614 for atanf, et al |
Open defects
| ID | Summary |
|---|---|
| CODEGEN-7227 | Compiler incorrectly optimizes unsigned loop counter which wraps around |
| CODEGEN-7018 | Math code runs faster with version 6.1.6 than with version 18.12.0.LTS |
| CODEGEN-6608 | C28 linker –relocatable option does not retain blocked section flags |
| CODEGEN-6509 | Compiler error: no instance of function template matches the argument list |
| CODEGEN-6070 | Erroneous “redeclared with incompatible type” involving two tagless structs with same form |
| CODEGEN-5426 | Optimizer generated comments incorrectly display hexadecimal floating point literals |
| CODEGEN-4960 | Using –gen_profile_info with code with CLA source fails to build |
| CODEGEN-4895 | For enum type variables incorrectly issue diagnostic: comparison between signed and unsigned operands |
| CODEGEN-4712 | No MISRA 10.1 and 10.6 diagnostics issued on initializations |
| CODEGEN-4617 | Compiler incorrectly issues MISRA 12.6 diagnostic: Expressions that are effectively Boolean should not be used |
| CODEGEN-4342 | cerr.tie() returns the wrong value |
| CODEGEN-1031 | C2000 float software multiply doesn't handle -1*INF properly |
| CODEGEN-1028 | C2000 can't print 0 with %a format |
| CODEGEN-793 | Ill advised enum scalar usage gets MISRA diagnostic, but similar usage of enum array does not |
| CODEGEN-792 | Array that is correctly initialized erroneously gets a MISRA diagnostic about size not being specified |
| CODEGEN-580 | C2000 RTS float arithmetic functions do not round correctly |
| CODEGEN-322 | Structure is not initialized correctly when using -o2 or -o3 optimization |
| CODEGEN-104 | Linker gives misleading warning when dot expressions used in SECTION directive for .stack section |
| CODEGEN-88 | strcmp doesn't correctly handle values with uppermost bit set |
| CODEGEN-71 | Extern inline functions are not supported in the C/C++ Compiler with COFF ABI |
| CODEGEN-63 | DWARF does not correctly represent variables stored in register pairs |
| CODEGEN-62 | pow(2,x) has fairly significant rounding error |
| CODEGEN-60 | printf gives wrong value for pointer when its value is incremented |
| CODEGEN-56 | Forward reference in .space generates an internal error |
| CODEGEN-30 | Compilers on PC will not work without TMP set |
1.2 Compiler Wiki
A Wiki has been established to assist developers in using TI Embedded Processor Software and Tools. Developers are encouraged to read and contribute to the articles. Registered users can update missing or incorrect information. There is a large section of compiler-related material. Please visit:
https://processors.wiki.ti.com/index.php?title=Category:Compiler
1.3 Compiler Documentation
The “TI C2000 Optimizing Compiler User’s Guide” and the “TI C2000 Assembly Language User’s Guide” can be downloaded from:
https://www.ti.com/tool/C2000-CGT
1.4 TI E2E Community
Questions concerning TI Code Generation Tools can be posted to the TI E2E Community forums. The Code Composer Studio support forum can be found at:
https://e2e.ti.com/support/tools/ccs/f/81
1.5 Defect Tracking Database
The Code Generation Tools Defect Database can be searched at:
1.6 Long Term Support release
The C2000 CGT v18.1.0.LTS release is a long term support (LTS) release. This release will be supported for roughly 2 years with periodic bug fix updates.
2 C++ ABI Compatibility
This release contains the first planned updates in preparation for the support of C++14 (International Standard ISO/IEC 14882:2014(E)). As part of this update, it is necessary to make changes which might cause errors when building C++ projects containing C++ object files compiled with older versions of the compiler.
These errors will usually include linktime errors involving undefined symbols. If you see undefined symbol errors during a link, pass the “–no_demangle” option to the compiler. If the undefined symbol’s name starts with _Z or _ZVT, then it’s possible that there is a C++ object file or library built with an older version of the tools being used. These will need to be compiled with the v18.1.0.LTS tools to work properly.
3 CLA code size improvements
Improvements in instruction scheduling have reduced code size 1 to 2% for
generated CLA code. The improvements are due to better flexibility in scheduling of CLA auxiliary register usage as well as improved modeling of the CLA pipeline’s write-followed-by-read restriction especially around branches and calls. These improvements are enabled by default during code generation.
4 C2000/CLA: Optimization of volatile bitfield assignments
Prior to this release, asignments to volatile bitfields would follow the read, modify, write methodology, even when such an operation is not needed. Consider the following code segment:
short a; struct str16 { short x:16; }; volatile struct str16 str16_vol;
void foo(void) { str16_vol.x = a; }
Prior to this optimization, str16_vol.x would be read before being assigned to, resulting in the C2000 assembly:
MOVW DP,#_str16_vol
MOV AL,@_str16_vol
MOV AL,@_a
MOV @_str16_vol,AL
The initial MOVW is unnecessary. With this release, such a move will not be generated on either C2000 or CLA.
5 CLA: Prefer direct addressing with –cla_support=cla[12]
When accessing and object multiple times in succession, earlier versions of the compiler would generate inefficient indirect addressing operations. For example, the following code:
struct { short x; short y; } dst_struct; dst_struct.y = 0;
Might generate the following assembly:
MMOVI16 MAR1,#_dst_struct
MNOP
MNOP
MMOVZ16 MR0,#0
MMOV16 *MAR1+[#1],MR0
In this release, the following assembly will be genereated instead:
MMOVZ16 MR0,#0
MMOV16 @_dst_struct+1,MR0
6 Improved stack usage with inline functions
The new compiler improves stack usage by sharing aggregate data originally defined in inline functions. Example:
struct ARGS { int f1,f2,f3,f4,f5; };
static inline void func1() { struct ARGS a = {1, 2, 3, 4, 5}; foo(&a); }
static inline void func2() { struct ARGS b = {1, 2, 3, 4, 5}; foo(&b); }
void func3() { func1(); func2(); }
In previous compilers, if func1 and func2 are inlined, the structs a and b would not share the same stack location. This version of the compiler will now share stack memory for local aggregates defined in inline functions.