1. Main Differences Between cl2000 and c29clang

This section of the Migration Guide describes the primary differences between the cl2000 compiler tools and the TI C29x Clang (c29clang) Compiler Tools.

For more information about the differences introduced below, see the following subsections:

Language Support For C/C++ and Assembly Differences

  • C/C++: There is no support for proprietary TI predefined macro symbols, pragmas, and intrinsics. Functionally equivalent alternatives should be used in their place.

  • CLA: There is no separate CLA compiler. Convert code intended for the CLA compiler to regular C code.

  • Assembly: Use of assembly language is discouraged for c29clang, except for assembly code that is embedded in C/C++ source files via asm() statements, which are processed inline by the c29clang integrated GNU-syntax assembler. Assembly language source files should be rewritten in C/C++.

For more information, see C/C++ and Assembly Language Differences.

Development Flow Related Differences

  • The c29clang compiler invokes the linker by default, whereas the user must specify cl2000’s -run_linker option to invoked the linker from the cl2000 command-line. However, the --rom_model (-c) linker option is not set by default by the c29clang compiler when running the linker. Therefore, the --rom_model (-c) or --ram_model (-cr) option must be passed to the linker on the c29clang command line or in the linker command file.

  • The c29clang compiler does not support a C/C++ interlist option from the compiler command-line.

  • The c29clang compiler ends compilation after emitting assembly output when using the -S option.

  • The c29clang compiler does not support altering the file extension of compiler generated files.

For more information, see Development Flow Differences.

Differences in Behavior of Binary Utilities

  • Only EABI output is supported for TI C29x. If your TI C28x application has COFF output files, you should first migrate from TI C28x COFF output to TI C28x EABI output before migrating to TI C29x. For information, see C2000 Migration from COFF to EABI.

  • The cl2000 compiler does not attempt to inline a function that contains an asm() statement, but the c29clang compiler inlines a function containing an asm() statement if it is beneficial to do so.

  • The command-line interface for the c29clang versions of the C++ Name Demangler Utility (c29dem) and the Name Utility (c29nm) behave differently than the cl2000 versions of dem2000 and nm2000.

For more information, see Binary Utility Differences.

Differences in Type Aliasing Assumptions

  • When optimizing memory accesses, c29clang assumes that pointers of different types cannot refer to the same memory. This means that if a pointer to an object is cast to a pointer of a different type, the compiler will treat the two pointers as not referencing the same memory. A user access of either pointer with the assumption that they refer to the same memory is undefined behavior. The C standard allows compilers to make a less conservative assumption about strict type aliasing in order to better optimize code to yield better performance. This behavior is consistent with that of other compilers, but it is different from cl2000, which makes a more conservative assumption while sacrificing optimization.

  • Users with code for which this poses problems should disable strict type aliasing by using the -fno-strict-aliasing compiler option.

For more information, see Controlling Optimization.