TMS470 C/C++ CODE GENERATION TOOLS
4.4.10.122 December 2014
Defect History

-------------------------------------------------------------------------------
Table of Contents
-------------------------------------------------------------------------------
1. Defects fixed in TMS470 Code Generation Tools release 4.4.10.122
2. Defects fixed in TMS470 Code Generation Tools release 4.4.10.121
3. Defects fixed in TMS470 Code Generation Tools release 4.4.10.120
4. Defects fixed in TMS470 Code Generation Tools release 4.4.10.119
5. Defects fixed in TMS470 Code Generation Tools release 4.4.10.118
6. Defects fixed in TMS470 Code Generation Tools release 4.4.10.117
7. Defects fixed in TMS470 Code Generation Tools release 4.4.10.116
8. Defects fixed in TMS470 Code Generation Tools release 4.4.10.115
9. Defects fixed in TMS470 Code Generation Tools release 4.4.10.114
10. Defects fixed in TMS470 Code Generation Tools release 4.4.10.113
11. Defects fixed in TMS470 Code Generation Tools release 4.4.10.112
12. Defects fixed in TMS470 Code Generation Tools release 4.4.10.111
13. Defects fixed in TMS470 Code Generation Tools release 4.4.10.110
14. Defects fixed in TMS470 Code Generation Tools release 4.4.10.109
15. Defects fixed in TMS470 Code Generation Tools release 4.4.10.108
16. Defects fixed in TMS470 Code Generation Tools release 4.4.10.107
17. Defects fixed in TMS470 Code Generation Tools release 4.4.10.106
18. Defects fixed in TMS470 Code Generation Tools release 4.4.10.105
19. Defects fixed in TMS470 Code Generation Tools release 4.4.10.104
20. Defects fixed in TMS470 Code Generation Tools release 4.4.10.103
21. Defects fixed in TMS470 Code Generation Tools release 4.4.10.102
22. Defects fixed in TMS470 Code Generation Tools release 4.4.10.101
23. Defects fixed in TMS470 Code Generation Tools release 4.4.10.100
24. Current Known Issues


===============================================================================
1. Defects fixed in TMS470 Code Generation Tools release 4.4.10.122
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.122, released December 2014.

-------------------------------------------------------------------------------
FIXED SDSCM00050721
-------------------------------------------------------------------------------

Summary            : Compiler truncates 64-bit case labels

Fixed in           : 4.4.10.122
Severity           : S2 - Major
Affected Component : Code Generator

Release Notes:
  In some cases, the compiler optimizes switch case label comparisons by
  computing the difference between two adjacent case labels. The bug is
  that the compiler may truncate this difference to a 32-bit value.
  
  Defect occurs in TMS470 Compiler versions: 4.4.10.100 - 4.4.10.121, 4.6.0B1 -
  4.6.6, 4.4.15.201 - 4.4.15.210, 4.9.0B1 - 4.9.9, 5.0.0B1 - 5.0.10, 5.1.0B1 -
  5.1.7, 5.0.4.102

Workaround:
  Do not use a switch involving case labels with value larger than 32 bits;
  use nested if/else statements instead.


===============================================================================
2. Defects fixed in TMS470 Code Generation Tools release 4.4.10.121
===============================================================================

The following 0 defects were fixed in TMS470 Code Generation Tools release
4.4.10.121, released October 2013.


===============================================================================
3. Defects fixed in TMS470 Code Generation Tools release 4.4.10.120
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.120, released August 2013.

-------------------------------------------------------------------------------
FIXED SDSCM00045381
-------------------------------------------------------------------------------

Summary            : Read of array element, before memcpy() overwrites it,
                     may be out of order

Fixed in           : 4.4.10.120
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  The two statements
  
    a = x[0];
    memcpy(&x[0], &x[1], K);
  
  may not occur in the correct order under certain conditions at -o2 and
  above. The memcpy() may overwrite the first element before it is saved
  in the variable. The problem is specific to memcpy().
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.117, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.210, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.7, 4.7.1.201 - 4.7.1.202, 5.0.0B1 - 5.0.3

Workaround:
  The test case is using memcpy() to implement a shift register in an
  array. More efficient, and also avoiding the problem, is to use a
  circular-queue arrangement: instead of having the head of the queue
  always be x[0] and implementing a pop by shifting the whole array, have
  the head be x[head] and implement the pop as head=(head+1)%arraysize.
  
  Or use -o1 or -o0.

-------------------------------------------------------------------------------
FIXED SDSCM00045562
-------------------------------------------------------------------------------

Summary            : Multiplication by power-of-2 wider than int may use
                     wrong type

Fixed in           : 4.4.10.120
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  When multiplying a variable of a type the same size as int, or smaller,
  by a constant power of two with a type wider than int, the compiler may
  convert the multiply into a shift-left, and use the wrong type, thus
  computing the wrong answer.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.117, 4.6.0B1 - 4.6.6, 4.4.15.200 - 4.4.15.210, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.7, 4.7.1.201 - 4.7.1.202, 5.0.0B1 - 5.0.2

Workaround:
  Make the variable the same wider-than-int type as the constant. Casting
  it may also work. Or compile at -o1 or -o0.


===============================================================================
4. Defects fixed in TMS470 Code Generation Tools release 4.4.10.119
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.119, released March 2013.

-------------------------------------------------------------------------------
FIXED SDSCM00045894
-------------------------------------------------------------------------------

Summary            : Use of option -pdse195 causes an incorrect error to be
                     generated

Fixed in           : 4.4.10.119
Severity           : S2 - Major
Affected Component : C/C++ Compiler (cl)

Release Notes:
  An issue where diagnostics resulting from the evaluation of unused
  preprocessor tokens has been fixed. This issue only arose when error #195
  was escalated to warning or error. For example, when compiling the
  following code with the option -pdse195:
  
     #define MY_CONCAT_DEFINE 1
     #define MY_CONCAT_MACRO(a, b) a##b
     #if (MY_CONCAT_MACRO(MY_,CONCAT_DEFINE) == 0)
     #error ("Define is zero")
     #endif
     int x;
  
  The compiler generates the following incorrect error message:
  
   "test.c", line 5: error: zero used for undefined preprocessing identifier
   #if (MY_CONCAT_MACRO(MY_,CONCAT_DEFINE) == 0)
   ^
   "test.c", line 5: error: zero used for undefined preprocessing identifier
   #if (MY_CONCAT_MACRO(MY_,CONCAT_DEFINE) == 0)
   ^
   2 errors detected in the compilation of "test.c".
   >> Compilation failure
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.117 - 4.4.10.118, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.210, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.7, 4.7.1.201 - 4.7.1.202, 5.0.0B1 - 5.0.3

Workaround:
  Compiling without -pdse195 will remove the errors caused by this issue.
  Alternatively, consider -pdsw195 if the diagnostic should be seen but not
  bar the program from compiling.


===============================================================================
5. Defects fixed in TMS470 Code Generation Tools release 4.4.10.118
===============================================================================

The following 4 defects were fixed in TMS470 Code Generation Tools release
4.4.10.118, released January 2013.

-------------------------------------------------------------------------------
FIXED SDSCM00040459
-------------------------------------------------------------------------------

Summary            : Division or modulo by most-negative-value of type may
                     produce incorrect answer

Fixed in           : 4.4.10.118
Severity           : S2 - Major
Affected Component : Optimizer
Duplicate Defects  : SDSCM00040538, SDSCM00040790

Release Notes:
  Division or modulo when the divisor is the most-negative-value of a
  signed type (eg, -128 for signed-char for C6x) may produce the wrong
  answer.
  
  
  Defect occurs in TMS470 Compiler versions: 2.41.beta - 2.50.beta, 4.4.10.100 -
  4.4.10.112, 4.6.0B1 - 4.6.6, 4.4.15.200 - 4.4.15.209, 4.7.0B1 - 4.7.1,
  4.8.0B1, 4.9.0B1 - 4.9.0, 4.7.1.201 - 4.7.1.202

Workaround:
  Using a wider type, for example int, should help. Compiling at -o0 may
  help. Negating the numerator instead of the denominator will avoid the
  problem.

-------------------------------------------------------------------------------
FIXED SDSCM00040651
-------------------------------------------------------------------------------

Summary            : Return statement with embedded assignment from a
                     post-increment or -decrement may return wrong value

Fixed in           : 4.4.10.118
Severity           : S2 - Major
Affected Component : C/C++ Compiler (cl)

Release Notes:
  A statement like "return j = i++" may return the value of i after it has
  been incremented, when it should return the value before the increment.
  It's possible that other cases exist, but all will involve an assignment
  of a post-increment or post-decrement embedded in another statement.
  
  Defect occurs in TMS470 Compiler versions: 2.41.beta - 2.71, 4.1.0B1 - 4.1.7,
  2.54.205 - 2.54.209, 2.54.110 - 2.54.129, 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.112, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.209, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.0, 4.7.1.201 - 4.7.1.202

Workaround:
  Do the assignment outside the return, as in "j = i; return i++;" or "j =
  i++; return j;"

-------------------------------------------------------------------------------
FIXED SDSCM00043948
-------------------------------------------------------------------------------

Summary            : IF predicate with negative integer factor simplifies
                     incorrectly

Fixed in           : 4.4.10.118
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  An IF predicate with a negative integer factor -- eg, "if (x*(-3) == -9)"
  -- may be simplified incorrectly, for instance to "if (x == -3)" instead
  of the correct "if (x == 3)".
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.116, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.209, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.5, 4.7.1.201 - 4.7.1.202, 5.0.0B1

Workaround:
  None. Avoid the situation.

-------------------------------------------------------------------------------
FIXED SDSCM00043966
-------------------------------------------------------------------------------

Summary            : Second instance of three-operand associative op may
                     miscompile

Fixed in           : 4.4.10.118
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  If two three-operand expressions using the same associative operator and
  two of the same operands occur in the same function -- for example, x*x*x
  and 30*x*x -- the second expression may miscompile and be treated as
  identical to the first.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.116, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.209, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.5, 4.7.1.201 - 4.7.1.202, 5.0.0B1

Workaround:
  Compile at -o1 or -o0, or avoid the situation.


===============================================================================
6. Defects fixed in TMS470 Code Generation Tools release 4.4.10.117
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.117, released July 2012.

-------------------------------------------------------------------------------
FIXED SDSCM00044048
-------------------------------------------------------------------------------

Summary            : Enabling vectorization produces incorrect code

Fixed in           : 4.4.10.117
Severity           : S2 - Major
Affected Component : Optimizer
Duplicate Defects  : SDSCM00045426

Release Notes:
  In certain cases, enabling vectorization could result in incorrect code
  being generated.
  
  Defect occurs in TMS470 Compiler versions: 4.4.10.100 - 4.4.10.116, 4.9.0B1 -
  4.9.6, 5.0.0B1 - 5.0.0

Workaround:
  Disable vectorization or optimization.


===============================================================================
7. Defects fixed in TMS470 Code Generation Tools release 4.4.10.116
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.116, released May 2012.

-------------------------------------------------------------------------------
FIXED SDSCM00043143
-------------------------------------------------------------------------------

Summary            : Compiler incorrectly rewrites expression as rotate
                     operation

Fixed in           : 4.4.10.116
Severity           : S2 - Major
Affected Component : C/C++ Compiler (cl)

Release Notes:
  The problem could occur when an expression matches one of:
  x << a | y >> b if a + b = vsz
  x >> a | y << b if a + b = vsz
     x << z | y >> (vsz - z)
     x << (vsz - z) | y >> z
  
  Where:
  a and b are constant integers
  vsz is the size of x and y in bits
  
  When all of:
  x and y are expressions involving . or -> operators with the same left-hand
  sides
  x and y are of exactly the same type
  x and y are of unsigned type
  
  Effect of optimization:
  When compiler optimizer is enabled at -O1 or higher, the optimizer may
  transform equivalent code sequences into an expression which causes the
  problem to occur. For example, the sequence { int x = s.a, y = s.b; return x
  << 16 | y >> 16; } could still cause the problem despite the shift/or
  expression not directly including a . or -> operator. This includes sequences
  which may be generated as a result of function inlining.

Workaround:
  Workaround 1:
  Make sure x and y can't include structure references, for example by using
  a function such as the following to compute the expression:
  #pragma FUNC_CANNOT_INLINE(f); /* omit "(f)" in C++ */
  unsigned f(unsigned x, unsigned a, unsigned y, unsigned b) { return x << a
  | y >> b; }
  
  Workaround 2:
  Use volatile temporaries for x and y, for example:
  volatile int x = s.a;
  volatile int y = s.b;
  return x << 16 | y >> 16;


===============================================================================
8. Defects fixed in TMS470 Code Generation Tools release 4.4.10.115
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.115, released April 2012.

-------------------------------------------------------------------------------
FIXED SDSCM00043642
-------------------------------------------------------------------------------

Summary            : Compiler incorrectly simplifies "(x >> k1) < k2" when k2
                     is constant smaller than int

Fixed in           : 4.4.10.115
Severity           : S1 - Critical / PS
Affected Component : C/C++ Compiler (cl)

Release Notes:
  Given an IF with a predicate like "(x >> k1) < k2", the compiler will
  attempt to convert it to "x < (k2<<k1)". If k2 is a literal or const
  variable whose type is too small to hold k2<<k1, the result will be
  incorrect. The compiler should use a wider type, the promoted type of
  x; the workaround is to do the same thing in the source.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.114, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.209, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.4, 4.7.1.201 - 4.7.1.202, 5.0.0B2 - 5.0.0B1

Workaround:
  Declare k2 as an int instead of a shorter type.


===============================================================================
9. Defects fixed in TMS470 Code Generation Tools release 4.4.10.114
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.114, released October 2011.

-------------------------------------------------------------------------------
FIXED SDSCM00042149
-------------------------------------------------------------------------------

Summary            : Signed bitfield in union with unsigned integer treated
                     as unsigned

Fixed in           : 4.4.10.114
Severity           : S1 - Critical / PS
Affected Component : C/C++ Compiler (cl)

Release Notes:
  Given a union containing a scalar integer field and a struct field
  consisting entirely of bitfields, such that the integer and the bitfield
  struct have the same number of bits, a signed bitfield may be treated
  (incorrectly) as unsigned if the scalar integer is unsigned.
  
  Defect occurs in TMS470 Compiler versions: 2.41.beta - 2.50.beta, 4.4.0B1 -
  4.4.18, 4.5.2, 4.4.10.113, 4.6.0B1 - 4.6.6, 4.4.15.201 - 4.4.15.209, 4.7.0B1 -
  4.7.1, 4.8.0B1, 4.9.0B1 - 4.9.1, 4.7.1.201 - 4.7.1.202, 4.10.0B1

Workaround:
  Use types of the same signedness in unions of integers and bitfield
  structs. Or compile at -o0.


===============================================================================
10. Defects fixed in TMS470 Code Generation Tools release 4.4.10.113
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.113, released July 2011.

-------------------------------------------------------------------------------
FIXED SDSCM00040128
-------------------------------------------------------------------------------

Summary            : Linker changes allocation order although input sources
                     remain the same

Fixed in           : 4.4.10.113
Severity           : S2 - Major
Affected Component : Linker

Release Notes:
  No Information Available; please see defect details.

Workaround:
  None.


===============================================================================
11. Defects fixed in TMS470 Code Generation Tools release 4.4.10.112
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.112, released May 2011.

-------------------------------------------------------------------------------
FIXED SDSCM00032856
-------------------------------------------------------------------------------

Summary            : application code runtime decrease of about 2% between
                     4.4.8 and 4.4.15

Fixed in           : 4.4.10.112
Severity           : S2 - Major
Classification     : Performance
Affected Component : C/C++ Compiler (cl)

Release Notes:
  Code using many accesses to small bitfields can be larger and slower than
  it was in earlier releases, because the struct accesses use the smallest
  valid type rather than a larger type that allows more combination of
  adjacent operations. The patch for this problem will try to use the
  declared type of the bitfield instead, which is usually int.
  
  Defect occurs in TMS470 Compiler versions: 4.4.15 - 4.4.16, 4.5.2, 4.6.0B1,
  4.4.15.200

Workaround:
  Making bitfield accesses in the same order as the fields can allow more
  combination, but won't relieve all the code growth.

-------------------------------------------------------------------------------
FIXED SDSCM00039969
-------------------------------------------------------------------------------

Summary            : 'signed short' bitfield treated as unsigned in EABI

Fixed in           : 4.4.10.112
Severity           : S1 - Critical / PS
Affected Component : C/C++ Compiler (cl)

Release Notes:
  No Information Available; please see defect details.

Workaround:
  None.


===============================================================================
12. Defects fixed in TMS470 Code Generation Tools release 4.4.10.111
===============================================================================

The following 0 defects were fixed in TMS470 Code Generation Tools release
4.4.10.111, released March 2011.


===============================================================================
13. Defects fixed in TMS470 Code Generation Tools release 4.4.10.110
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.110, released March 2011.

-------------------------------------------------------------------------------
FIXED SDSCM00039013
-------------------------------------------------------------------------------

Summary            : Optimizer incorrectly optimizes ((x<<n)|y)&k

Fixed in           : 4.4.10.110
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  In an expression like ((uc1<<8)|uc2)&0x200, where uc1 and uc2 are 8-bit
  variables, the compiler can tell that uc2 is irrelevant to the result --
  all its bits are ANDed with 0. Unfortunately, in simplifying the
  expression, it interprets 0x200 with the type of uc2 and truncates it to
  , producing incorrect code.
  
  The problem is limited to (A|B)&C or (A&B)|C expressions, where B's type
  is narrower than C's. In this particular test case, (A|B) was an
  argument to an inlined function and the AND was in the body, but other
  kinds of propagation can bring the sub-expressions together.
  
  A sample test case that demonstrates this bug follows:
  
  #include <stdio.h>
  
  typedef unsigned char U8;
  typedef unsigned short U16;
  typedef unsigned int U32;
  
  U16 parameter_mask;
  U32 mask;
  
  U8 parameters[6] = { 1, 1, 1, 1, 2, 0 };
  
  main()
  {
      parameter_mask = (parameters[5] | (parameters[4] << 8U));
  
      mask = 0;
      mask |= ( 0x00000001U );
  
      if ((parameter_mask & 0x0200) == 0x0200)
      {
          mask |= 4;
      }
  
      printf("simple mask = 0x%d (should be 0x5)\n", mask);
  }
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.178e, 2.209e, 2.40.beta
  - 2.71, 4.1.0B1 - 4.1.7, 2.54.02 - 2.54.208, 2.54.03 - 2.54.128, 2.202.03e -
  2.202.15e, 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2, 4.4.10.100 - 4.4.10.109, 4.6.0B1
  - 4.6.4, 4.4.15.200 - 4.4.15.208, 4.7.0B1 - 4.7.1, 4.8.0B1, 4.9.0B1

Workaround:
  Avoid constructing the (A|B)&C form when it fits the conditions. In this
  test case, controlling inlining (as with -o2) is enough. Using a global
  variable instead of a local variable for the OR subexpression also
  inhibits the necessary propagation.

-------------------------------------------------------------------------------
FIXED SDSCM00039083
-------------------------------------------------------------------------------

Summary            : Compiler incorrectly removes compare against zero

Fixed in           : 4.4.10.110
Severity           : S2 - Major
Affected Component : Code Generator

Release Notes:
  If an unsigned integer arithmetic expression is followed by a comparison where
  the result of the unsigned expression is cast to a signed integer type, the
  compiler may rewrite the compare incorrectly. The defect can occur in the
  following code as an example:
  
  typedef union
  {
  unsigned int unsignedNum;
  int signedNum;
  } myType;
  
  main()
  {
  myType tmp;
  tmp.unsignedNum = 0xbb7U - 0x80000001U;
  
  if (tmp.signedNum > 0) error();
  }
  
  The conversion could take place implicitly as above or with an explicit cast.
  Please note that the conversion above from an unsigned to signed is only "implementation-
  defined" according to the C/C++ standards. Not all compilers are required to
  generate a bit-by-bit copy and thus such code is not fully portable.
  
  Also, code converting an unsigned int to signed can violate MISRA rules. For
  example rule 10.1 states: "The value of an expression of integer type shall
  not be implicitly converted to a different underlying type if it is not a
  conversion to a wider integer type of the same signedness."
  
  A compare to 0 cannot be removed when the instruction that will now set the
  status bits is an unsigned instruction and there exists a branch that uses
  more than the Z/N bits. This will prevent the branch from relying on a V bit
  that could be in an invalid state.

Workaround:
  No workaround implemented. Turning off the remove compare to 0 optimization
  altogether significantly impacts performance.


===============================================================================
14. Defects fixed in TMS470 Code Generation Tools release 4.4.10.109
===============================================================================

The following 4 defects were fixed in TMS470 Code Generation Tools release
4.4.10.109, released January 2011.

-------------------------------------------------------------------------------
FIXED SDSCM00038498
-------------------------------------------------------------------------------

Summary            : ASM470 INTERNAL ERROR segmentation fault

Fixed in           : 4.4.10.109
Severity           : S2 - Major
Affected Component : Assembler

Release Notes:
  On versions 4.4.x, a source file with many header files included (over
  2100 in this case), can cause the assembler to crash from insufficient
  memory.
  
  Defect occurs in TMS470 Compiler versions: 4.4.10.108

Workaround:
  Use any arm version 4.6.0 and later. Or, do not use debug.

-------------------------------------------------------------------------------
FIXED SDSCM00038502
-------------------------------------------------------------------------------

Summary            : lnk470 internal error

Fixed in           : 4.4.10.109
Severity           : S2 - Major
Affected Component : Linker

Release Notes:
  After a linker reports a placement error, the linker crashes with an
  internal error.

Workaround:
  The placement error is caused by a memory region of sufficient size being
  available. Once the memory regions or sections are updated to allow for
  placement, the crash will not occur.

-------------------------------------------------------------------------------
FIXED SDSCM00038766
-------------------------------------------------------------------------------

Summary            : Optimizer loses side effect in "expr % 1" - (codegen
                     contains same bug SDSCM00038778)

Fixed in           : 4.4.10.109
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  Any expression modulo 1 -- "expr % 1" -- will be replaced by 0, because
  that's what it evaluates to. However, it is incorrect to completely
  remove "expr" if it has a side effect, such as incrementing a variable;
  the correct simplification is to "(expr, 0)".
  
  A similar problem exists for "((long)expr) / k" where the types int and
  long are distinct and k > INT_MAX.
  
  Defect occurs in TMS470 Compiler versions: 2.41.beta - 2.71, 4.1.0B1 - 4.1.7,
  2.54.205 - 2.54.208, 2.54.110 - 2.54.127, 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.108, 4.6.0B1 - 4.6.4, 4.4.15.201 - 4.4.15.208, 4.7.0B1 - 4.7.1, 4.8.0B1

Workaround:
  Do the side effect before the modulo.

-------------------------------------------------------------------------------
FIXED SDSCM00038778
-------------------------------------------------------------------------------

Summary            : Codegen missing increment operation - (optimizer
                     contains same bug SDSCM00038766)

Fixed in           : 4.4.10.109
Severity           : S2 - Major
Affected Component : Code Generator

Release Notes:
  For any value of x, the expression 'x % 1' results in 0. The compiler
  will perform this simplification but will incorrectly not evaluate x for
  side effects (eg. x++, x(), etc.). The compiler has been updated to
  evaluate x if there is a side effect.
  
  Defect occurs in TMS470 Compiler versions: 2.41.beta - 2.71, 4.1.3 - 4.1.7,
  2.54.205 - 2.54.208, 2.54.110 - 2.54.127, 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.100 - 4.4.10.108, 4.6.0B1 - 4.6.4, 4.4.15.201 - 4.4.15.208, 4.7.0B1 -
  4.7.1, 4.8.0B1

Workaround:
  Other than replacing 'x % 1' with 'x,0' no available compiler workarounds.


===============================================================================
15. Defects fixed in TMS470 Code Generation Tools release 4.4.10.108
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.108, released September 2010.

-------------------------------------------------------------------------------
FIXED SDSCM00037599
-------------------------------------------------------------------------------

Summary            : Linker generates overlapping sections when group split
                     across two sections

Fixed in           : 4.4.10.108
Severity           : S2 - Major
Affected Component : Linker

Release Notes:
  The linker generates overlapping sections when a group is split across
  two sections. The linker is not accounting for alignment. Fixed.
  
  Defect occurs in TMS470 Compiler versions: 4.4.10.107

Workaround:
  None available

-------------------------------------------------------------------------------
FIXED SDSCM00037883
-------------------------------------------------------------------------------

Summary            : INTERNAL ERROR: optimizer experienced a segmentation
                     fault

Fixed in           : 4.4.10.108
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  A struct field with a very long name (in this case, 81 characters),
  especially if it's more than 68 characters, can lead to an optimiser
  segmentation fault when compiling with -s or -os. The long name causes a
  buffer overflow while printing the optimiser comments for the .asm file.
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.177e, 2.209e, 2.40.beta
  - 2.71, 4.1.0B1 - 4.1.7, 2.54.02 - 2.54.208, 2.54.03 - 2.54.127, 2.202.03e -
  2.202.14e, 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2, 4.4.10.100 - 4.4.10.107, 4.6.0B1
  - 4.6.4, 4.4.15.200 - 4.4.15.208, 4.7.0B1 - 4.7.0

Workaround:
  Don't use -s or -os; the problem occurs when printing the optimiser
  comment for the .asm file.


===============================================================================
16. Defects fixed in TMS470 Code Generation Tools release 4.4.10.107
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.107, released July 2010.

-------------------------------------------------------------------------------
FIXED SDSCM00036956
-------------------------------------------------------------------------------

Summary            : Compiler gives error "Offset out of range" when compiled
                     for Thumb-2

Fixed in           : 4.4.10.107
Severity           : S2 - Major
Affected Component : Code Generator

Release Notes:
  The compiler is generating the following incorrect instruction:
  
  LDRB A1, [A1, #-2147483648]
  
  This causes the assembler to generate an error:
  
  test.asm", ERROR! at line 377: [E0200] Offset out of
  range, must be
  [-255,4095]

Workaround:
  There is no workaround

-------------------------------------------------------------------------------
FIXED SDSCM00037294
-------------------------------------------------------------------------------

Summary            : -ms causes infinite loop and internal error

Fixed in           : 4.4.10.107
Severity           : S3 - Minor
Affected Component : Code Generator

Release Notes:
  When compiling a testcase with -ms option the compiler hangs in infinite loop,
  when the process is terminated the compiler
  prints internal error message:
  
  cl470 -g -o2 -ms file.c
  ......
  
  INTERNAL ERROR: cg470 experienced a fatal internal fault while
  processing function _foo file file.c line 12
  
  This is a serious problem. Please contact Customer
  Support with this message and a copy of the input file
  and help us to continue to make the tools more robust.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.18, 4.5.0B1 - 4.5.2,
  4.4.10.106, 4.6.0B1 - 4.6.4, 4.4.15.201 - 4.4.15.208, 4.7.0B1 - 4.7.0B3

Workaround:
  When generating ARM constant tables the compiler will loop indefinitely
  for the given instruction sequence that includes a debug directive:
  
  CALL
  DEBUG DIRECTIVE (In this case source line information)
  UNCONDITIONAL BRANCH
  
  For this test case the sequence and the large number of constants is
  encountered in the large switch statements in the function out(). One
  workaround could be to compile without debug since the presence of debug
  directives is necessary to trigger the problem sequence. Also, the
  compiler constant table pass is very sensitive to changes in the code so
  using different option settings may avoid the problem sequence.
  For example, compiling with --optimize_with_debug seems to avoid the
  sequence.


===============================================================================
17. Defects fixed in TMS470 Code Generation Tools release 4.4.10.106
===============================================================================

The following 2 defects were fixed in TMS470 Code Generation Tools release
4.4.10.106, released June 2010.

-------------------------------------------------------------------------------
FIXED SDSCM00036932
-------------------------------------------------------------------------------

Summary            : Compiler uses incorrect argument registers in thumb-2
                     mode

Fixed in           : 4.4.10.106
Severity           : S1 - Critical / PS
Affected Component : Code Generator

Release Notes:
  
  The TMS470 thumb2 compiler contains an optimization to improve code size by
  changing certain types of IT blocks into blocks of code with a CBZ instruction
  replacing the IT instruction. For example, the following code:
  
      CMP reg1, #0
      IT EQ
      MOVEQ reg2, reg3
  
  is changed to:
  
      CBNZ reg1, label
      MOV reg2, reg3
      label:
  
  The defect occurs because the predicate is removed from the instructions
  following the IT since it is no longer an IT block. In specific situations,
  this lost predicate can cause a different routine, calling the routine that
  has this optimization, to generate incorrect code.
  
  Here is an example. A function, named fun1, which takes 4 arguments, contains
  this IT to CBZ optimization such that one of the argument registers is defined
  in the IT block:
  
  fun1:
  CBNZ A4, label
  MOV A2, A3
  label:
  LDR A1, [A1, #0]
  LDR A2, [A1, #0]
  BX LR
  
  If fun1 is defined in a source file before any other routine in the same
  source file that calls fun1, this bug could occur in the code generated for
  the call to fun1. The defect occurs because the argument register A2 is
  defined by the move instruction following the CBNZ. A routine calling fun1
  relies on the predicate information on an instruction to determine the
  behavior of the called routine. Since the IT to CBZ optimization removed the
  predicate, the compiler incorrectly computes that the second argument to fun1,
  passed in A2, is not used by fun1. The code generated to call fun1 will not
  pass the correct argument into A2 and the defect occurs.
  
  
  
  
  Conditions Necessary For SDSCM00036932
  
  1.  The code must be compiled for thumb2.
  2.  The code must be compiled with optimization level -o2 or higher.
  3.  The code is not compiled for speed. The build does not include the
      --opt_for_speed, or -mf, switch. Without a value, -mf defaults to -
      mf=4. This bug does not occur at -mf=3 or higher. It can occur with
      -mf=2 or lower.
  4.  The called routine, as described above, must occur in the same file where
      the calls occur. Calls across files are not affected by this bug.
  5.  The called routine must be defined in the source before any routine that
      calls the affected function.
  6.  The called routine must contain arguments.
  7.  The called routine must include a CBZ or CBNZ instruction that is followed
      by an instruction that conditionally defines one of the argument
      registers. There can be no preceding reference to this argument register
      prior to the CBZ.
  
  With these conditions, any routine calling this affected function could
  generate incorrect code to set up the arguments to the affected function.

Workaround:
  None.

-------------------------------------------------------------------------------
FIXED SDSCM00036994
-------------------------------------------------------------------------------

Summary            : Compilation hangs in optimization phase when compiled
                     for Thumb mode

Fixed in           : 4.4.10.106
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  The optimizer is stuck in infinite recursion, when compiled with -oi0.
  The source contained several consecutive statements that each contain two
  calls and each call causes a recursive search.

Workaround:
  Do not use -oi0.


===============================================================================
18. Defects fixed in TMS470 Code Generation Tools release 4.4.10.105
===============================================================================

The following 3 defects were fixed in TMS470 Code Generation Tools release
4.4.10.105, released March 2010.

-------------------------------------------------------------------------------
FIXED SDSCM00033854
-------------------------------------------------------------------------------

Summary            : The compiler ignores all but the last --preinclude
                     option

Fixed in           : 4.4.10.105
Severity           : S3 - Minor
Affected Component : Shell

Release Notes:
  Instead of processing multiple --preinclude options as documented, the
  compiler
  shell will only process the last --preinclude option that appears on the
  command line if more than one is specified.
  
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.17, 4.5.0B1 - 4.5.2,
  4.4.10.104, 4.6.0B1 - 4.6.1, 4.4.15.201 - 4.4.15.204

Workaround:
  One workaround would be to create another include file that conditionally
  #include's the files specified with the --preinclude option
  and use the -D option to define symbols to control which files should be
  included.

-------------------------------------------------------------------------------
FIXED SDSCM00034147
-------------------------------------------------------------------------------

Summary            : The compiler incorrectly accesses ioport variables

Fixed in           : 4.4.10.105
Severity           : S2 - Major
Affected Component : C/C++ Compiler (cl)

Release Notes:
  The code generator may incorrectly access ioport variables in
  subexpressions involving the following identity type of operations:
  
  A / 1 
  A ^ 0 
  A | 0 
  -(-A)
  ~(~A))
  A >> 0
  A << 0
  
  where 'A' is a variable DECLARED WITH THE IOPORT TYPE QUALIFIER.
  The code generator, when simplifying the above expressions
  to just 'A', may not generate a readport instruction leading to an
  incorrect access for reading 'A'.
  
  Defect occurs in TMS470 Compiler versions: 2.176e - 2.177e, 2.54.125 -
  2.54.126, 2.202.13e - 2.202.14e, 4.4.16 - 4.4.18, 4.5.2, 4.4.10.103 -
  4.4.10.104, 4.6.0B1 - 4.6.1
  
      * Expected release version containing a fix: 4.3.6
      * Expected date of this release (YYYY-MM-DD): 2010-02-26

Workaround:
  Possible workarounds would be to compile with optimization or rework the
  subexpression to not shift if shift value is 0 (if shift value is known at
  compile time this would not impact performance).

-------------------------------------------------------------------------------
FIXED SDSCM00035391
-------------------------------------------------------------------------------

Summary            : Compiler sometimes generates wrong branch instruction

Fixed in           : 4.4.10.105
Severity           : S1 - Critical / PS
Affected Component : Optimizer

Release Notes:
  A conditional expression whose predicate contains the general form
  ((x>>k1)<<k2), where k1 and k2 are literal integers and k2>k1, may
  compile incorrectly in a way that produces incorrect answers when x<0.
  These expressions may be either explicit in the source code, or
  implicitly derived from bitfield struct references. See also CQ16340.
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.177e, 2.54.03 -
  2.54.126, 2.202.03e - 2.202.14e, 4.4.0B1 - 4.4.18, 4.4.10.104, 4.4.15.201 -
  4.4.15.206

Workaround:
  Varying the optimisation level may help; this test case only fails with
  -o1, though we have heard of other cases failing at other levels. Moving
  the shift expression out of the predicate and into a local variable is
  also useful.


===============================================================================
19. Defects fixed in TMS470 Code Generation Tools release 4.4.10.104
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.104, released July 2009.

-------------------------------------------------------------------------------
FIXED SDSCM00032470
-------------------------------------------------------------------------------

Summary            : PC optimizer segmentation fault under eabi while
                     processing huge function with lots of if/else statements
                     and huge structures

Fixed in           : 4.4.10.104
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  On Windows only, compiling a very large function with many references to
  global, aliased, or union variables may cause an optimiser crash due to a
  stack overflow.
  
  Defect occurs in TMS470 Compiler versions: 4.1.0B1 - 4.1.7, 4.4.0B1 - 4.4.16,
  4.5.0B1 - 4.5.2, 4.4.10.100 - 4.4.10.103, 4.6.0B1

Workaround:
  Use smaller functions, fewer globals, fewer unions, and take the address
  of fewer variables. Or increase the allowed stack size.


===============================================================================
20. Defects fixed in TMS470 Code Generation Tools release 4.4.10.103
===============================================================================

The following 4 defects were fixed in TMS470 Code Generation Tools release
4.4.10.103, released April 2009.

-------------------------------------------------------------------------------
FIXED SDSCM00030599
-------------------------------------------------------------------------------

Summary            : Fill sections get created between certain group output
                     sections

Fixed in           : 4.4.10.103
Severity           : S2 - Major
Affected Component : ELF Linker

Release Notes:
  The linker was creating a fill section between 2 output sections of a
  group. There is no fill on the memory region for this group. This fill
  should not occur.

Workaround:
  None

-------------------------------------------------------------------------------
FIXED SDSCM00030689
-------------------------------------------------------------------------------

Summary            : Describe DWARF tag information for all function exits

Fixed in           : 4.4.10.103
Severity           : S2 - Major
Affected Component : C/C++ Compiler (cl)

Release Notes:
  Missing DW_AT_TI_return debug tag for return statement. This could cause
  wrong behavior in debugging, wrong profiling information and so on.
  
  Defect occurs in TMS470 Compiler versions: 4.4.10.100 - 4.4.10.102

Workaround:
  There is no work around for this problem

-------------------------------------------------------------------------------
FIXED SDSCM00031009
-------------------------------------------------------------------------------

Summary            : unexpected fill section using GROUP directive on
                     intialized and uninitialized output section in same
                     memory type

Fixed in           : 4.4.10.103
Severity           : S2 - Major
Affected Component : Linker

Release Notes:
  The linker was erroneously creating a fill section in a GROUP which contained
  unitialized data. This was because, for EABI, the linker treats .data as
  initialized. It does this because it has to copy the data from the section
  to a compressed output section.

Workaround:
  None.

-------------------------------------------------------------------------------
FIXED SDSCM00031215
-------------------------------------------------------------------------------

Summary            : Compiler generates incorrect call to wrong library
                     divide routine

Fixed in           : 4.4.10.103
Severity           : S1 - Critical / PS
Affected Component : Code Generator

Release Notes:
  The compiler could generate an incorrect divide routine call in some
  expressions that mix signed and unsigned types.
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.175e, 2.41.beta - 2.71,
  4.1.0B1 - 4.1.6, 2.54.205 - 2.54.208, 2.54.124, 2.202.03e - 2.202.12e, 4.4.0B1
  - 4.4.15, 4.5.0B1 - 4.5.1, 4.4.10.100 - 4.4.10.102

Workaround:
  None.


===============================================================================
21. Defects fixed in TMS470 Code Generation Tools release 4.4.10.102
===============================================================================

The following 3 defects were fixed in TMS470 Code Generation Tools release
4.4.10.102, released October 2008.

-------------------------------------------------------------------------------
FIXED SDSCM00028528
-------------------------------------------------------------------------------

Summary            : Linker crash when split operator >> fails to allocate

Fixed in           : 4.4.10.102
Severity           : S2 - Major
Affected Component : Linker

Release Notes:
  The linker could crash in certain instances when the split operator is
  used in a linker command file.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0 - 4.4.12, 4.5.0B1 - 4.5.0,
  4.4.10.101

Workaround:
  none

-------------------------------------------------------------------------------
FIXED SDSCM00028680
-------------------------------------------------------------------------------

Summary            : Compiler incorrectly handles assignment to structure
                     members

Fixed in           : 4.4.10.102
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  A struct definition that places bitfields adjacent to normal fields in a
  way that both fit within an int-sized aligned access, combined with code
  that writes to both fields, may lead to erroneous writes to the normal
  fields.
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.174e, 2.41.beta - 2.71,
  4.1.0B1 - 4.1.6, 2.54.205 - 2.54.208, 2.54.121 - 2.54.122, 2.202.03e -
  2.202.11e, 4.4.0B1 - 4.4.12, 4.4.10.100 - 4.4.10.101

Workaround:
  Compile at -o1 or less, or restructure the data so bitfields are
  separated from adjacent normal fields by padding. It may also help to
  write to the normal fields after the bitfields rather than before.

-------------------------------------------------------------------------------
FIXED SDSCM00028898
-------------------------------------------------------------------------------

Summary            : TMS470 optimizer fix for CQ28680 is incomplete

Fixed in           : 4.4.10.102
Severity           : S1 - Critical / PS
Affected Component : Optimizer

Release Notes:
  The update that was supposed to fix CQ28680 had a flaw that prevented it
  from helping except for fields with offset 0.
  
  Defect occurs in TMS470 Compiler versions: 2.166e - 2.174e, 2.41.beta - 2.71,
  4.1.0B1 - 4.1.6, 2.54.205 - 2.54.208, 2.54.123, 2.202.03e - 2.202.11e, 4.4.0B1
  - 4.4.12, 4.4.10.100 - 4.4.10.101

Workaround:
  None.


===============================================================================
22. Defects fixed in TMS470 Code Generation Tools release 4.4.10.101
===============================================================================

The following 3 defects were fixed in TMS470 Code Generation Tools release
4.4.10.101, released September 2008.

-------------------------------------------------------------------------------
FIXED SDSCM00022914
-------------------------------------------------------------------------------

Summary            : Errors opening PDF files included in the 4.4.6 cgtools
                     version

Fixed in           : 4.4.10.101
Severity           : S2 - Major
Affected Component : Shell

Release Notes:
  No Information Available; please see defect details.

Workaround:
  None.

-------------------------------------------------------------------------------
FIXED SDSCM00027886
-------------------------------------------------------------------------------

Summary            : BKPT instruction encoded incorrect in ARM mode

Fixed in           : 4.4.10.101
Severity           : S2 - Major
Affected Component : Assembler

Release Notes:
  The BKPT ARM instruction is not encoded correctly. Bits 4 to 7 are
  encoded as 0x0 instead of 0x7.
  
  Defect occurs in TMS470 Compiler versions: 4.1.0B1 - 4.1.6, 4.4.11 - 4.4.12,
  4.5.0B1 - 4.5.0, 4.4.10.100

Workaround:
  None.

-------------------------------------------------------------------------------
FIXED SDSCM00027986
-------------------------------------------------------------------------------

Summary            : internal optimizer error with segmentation fault

Fixed in           : 4.4.10.101
Severity           : S2 - Major
Affected Component : Optimizer

Release Notes:
  Certain large functions can lead to excessive allocation in the
  optimiser. In this case, functions with 3000 to 6000 lines led to
  process sizes in the 3-4 GB range. With this patch, the peak process
  size is around 800 MB.
  
  Defect occurs in TMS470 Compiler versions: 4.4.0B1 - 4.4.12, 4.4.10.100

Workaround:
  Use smaller functions or compile at a lower optimisation level.


===============================================================================
23. Defects fixed in TMS470 Code Generation Tools release 4.4.10.100
===============================================================================

The following defect was fixed in TMS470 Code Generation Tools release
4.4.10.100, released July 2008.

-------------------------------------------------------------------------------
FIXED SDSCM00008276
-------------------------------------------------------------------------------

Summary            : Linker accepts illegal address ranges and truncates to a
                     valid address

Fixed in           : 4.4.10.100
Severity           : S3 - Minor
Affected Component : Linker

Release Notes:
  The linker will now generate an out of range error:
  
  <Linking>
  "./test.cmd", line 4: error: integer constant does not fit within 32-bits:
  "0x123456789"
  error: errors encountered during linking; "test.out" not built

Workaround:
  None.


===============================================================================
24. Current Known Issues
===============================================================================

There are no known issues for TMS470 Code Generation Tools release 4.4.10.122
as of December 2014.

