ARM C/C++ CODE GENERATION TOOLS
4.7.1.202 March 2011
Defect History

------------------------------------------------------------------------------
Table of Contents
------------------------------------------------------------------------------
1. 4.7.1.202 Fixed Defects
2. 4.7.1.201 Fixed Defects
3. 4.7.1 Fixed Defects
4. 4.7.0 Fixed Defects
5. 4.7.0B3 Fixed Defects
6. Current Known Issues


------------------------------------------------------------------------------
1. 4.7.1.202 Fixed Defects
------------------------------------------------------------------------------

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

Summary            : Compiler incorrectly removes compare against zero

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

Description: Rework of 39083 to avoid machine register allocation changes
in generated code.


------------------------------------------------------------------------------
2. 4.7.1.201 Fixed Defects
------------------------------------------------------------------------------

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

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

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

Description: 
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 0, 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);
}

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

Summary            : Compiler incorrectly removes compare against zero

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

Description: 
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."


------------------------------------------------------------------------------
3. 4.7.1 Fixed Defects
------------------------------------------------------------------------------

------------------------------------------------------------------------------
FIXED  SDSCM00030738
------------------------------------------------------------------------------

Summary            : Interlisting comments for an asm() statement may
		     incorrectly show it comes from an inline function

Fixed in           : 4.7.1
Severity           : S3 - Minor
Affected Component : C/C++ Compiler (cl)

Description: 
The defect fix removes the inline function interlisting comment from
statements that did not originate from an inlined function.

------------------------------------------------------------------------------
FIXED  SDSCM00037361
------------------------------------------------------------------------------

Summary            : ilinker fails to merge incomplete types causing opt
		     assertion failure

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

Description: 
For this test case, a reference to a symbol is not getting its type resolved 
correctly during link time optimization.  The failure to merge arises from the
use of a type qualifier on a forward reference to a struct.  

------------------------------------------------------------------------------
FIXED  SDSCM00037398
------------------------------------------------------------------------------

Summary            : After memcpy is inlined, store to memory becomes write to
		     unaligned memory

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

Description: 
A call to memcpy() within a function that is inlined, when the source
or destination pointer points to a field within a struct that has a
smaller alignment than the struct itself, and the copy count is a known
constant, may lead to incorrectly-aligned memory accesses.

------------------------------------------------------------------------------
FIXED  SDSCM00037405
------------------------------------------------------------------------------

Summary            : LTO crashes with 'TP>> internal error invalid
		     foward reference' error

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

------------------------------------------------------------------------------
FIXED  SDSCM00037407
------------------------------------------------------------------------------

Summary            : Test case fails ARM -o4

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

Description: 
Given a local variable X and a pointer P = &X, if X is only written by 
using X directly and only read as *P, and P was set to &X by calling a 
function that returned &X, then writes to X may be incorrectly removed.

------------------------------------------------------------------------------
FIXED  SDSCM00037575
------------------------------------------------------------------------------

Summary            : Object in partial link overides linker command file if the
		     same file names are used.

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

Description: 
This bug is caused by an issue with link-time optimization and the 
requirement that file names with the same base name have the full path 
appended to the section name for a partial link. If not performing 
link-time optimization the behavior should be as expected

------------------------------------------------------------------------------
FIXED  SDSCM00037576
------------------------------------------------------------------------------

Summary            : palign increases section size to 256MB

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

Description: 
In the test case there are three block sizes should be 16K 8K and 2K 
respectively.  In the case that the link works, the blocks appear 
correctly in the linker command file as a total of 48k.  It is only
when the allocation fails and there was not enough room for the 48K that the
blocks are 256MB.  It is expected the original block sizes of 16K, 8K,
and 2K would be preserved.

------------------------------------------------------------------------------
FIXED  SDSCM00037588
------------------------------------------------------------------------------

Summary            : Functions that take a struct with a single floating point
		     member passed by value may not work correctly when VFP 
                     is enabled

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

Description: 
This bug has to do with passing structs with one double or float field
by value to a function if VFP is enabled. The function will most likely 
"lose" the field and end up using an incorrect value for the field.

------------------------------------------------------------------------------
FIXED  SDSCM00037734
------------------------------------------------------------------------------

Summary            : GCC language extension allowing arithmetic on void* and
		     function pointers generates incorrect
		     code

Fixed in           : 4.7.1
Severity           : S2 - Major
Affected Component : Parser

Description: 
When GCC language extensions are enabled,  void* pointers and function
pointers may be used with addition and subtraction operations. 

Use of the pre- and post- increment and decrement operators, and -
operator between two pointers produce bad code with void* pointers.

Use of the pre- and post- increment and decrement operators, += 
operation, -= operator and - operator between two pointers produce bad
code with function pointers.

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

Summary            : INTERNAL ERROR opt470.exe experienced a segmentation fault

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

Description: 
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.

------------------------------------------------------------------------------
FIXED  SDSCM00037899
------------------------------------------------------------------------------

Summary            : INTERNAL ERROR asm470.exe experienced a segmentation

Fixed in           : 4.7.1
Severity           : S1 - Critical / PS
Affected Component : Assembler

Description: 
The assembler or linker could crash during the processing of the DWARF 
debug info that is added with the -g switch.


------------------------------------------------------------------------------
4. 4.7.0 Fixed Defects
------------------------------------------------------------------------------

------------------------------------------------------------------------------
FIXED  SDSCM00035387
------------------------------------------------------------------------------

Summary            : INTERNAL ERROR no match for UMCALL

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

Description: 
#pragma CODE_SIZE(func1, 32);
  #pragma CODE_SIZE(func2, 16);

  void func2()
  {
  func1();
  }

  void func1()
  {
  _disable_IRQ() // only supported in arm mode
  }

Previously, the optimizer was inlining func1 which causes the arm mode
only intrinsic _disable_IRQ() to appear inside thumb mode func2. As a
result, the codegen matcher fails to find a match for the intrinsic.
We now inhibit function inlining for ARM when the caller/callee have
different code states.

------------------------------------------------------------------------------
FIXED  SDSCM00037083
------------------------------------------------------------------------------

Summary            : ARM compiler generates incorrect code for VFP multiply
		     accumulate negate (VNMLA) instruction

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

Description: 
ARM VFP instructions for float and double VNMLA, multiply accumulate 
negate, are generated incorrectly as VMLS, multiply subtract 
instructions.  This pertains to source code that has the specific form
c = -(c+(a*b)) where c, a and b are floats or doubles.  Other equivalent
variations of source code such as c = -c - (a*b) do not produce
incorrect results.

------------------------------------------------------------------------------
FIXED  SDSCM00037218
------------------------------------------------------------------------------

Summary            : IF with NULL-pointer check and bit test may misplace NULL
		     check

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

Description: 
A statement like

  if (p != 0 && (x & k1) == 0) *p = *p | k2;

may be rearranged incorrectly in a way that allows *p to happen whether
or not p is NULL.  For that to happen, several conditions must be
present.  The assignment must be an OR or XOR that reads and writes the
same location, k2 must be a literal integer that is a power of 2, and
the IF predicate must contain both a NULL-pointer check and a bit-test
using AND in which k1 is a power of 2.

------------------------------------------------------------------------------
FIXED  SDSCM00037225
------------------------------------------------------------------------------

Summary            : Compiler for ARM v7 targets with VFP formats assembly
		     instructions "FCMPESZ" and "FCMPEDZ" incorrectly

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

Description: 
Compiler for ARM v7 targets with VFP formats assembly instructions
FCMPESZ and FCMPEDZ incorrectly.  These instructions should be FCMPEZS
and FCMPEZD.  

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

Summary            : -ms causes infinite loop and internal error

Fixed in           : 4.7.0
Severity           : S3 - Minor
Affected Component : C/C++ Compiler (cl)

Description: 
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.


------------------------------------------------------------------------------
5. 4.7.0B3 Fixed Defects
------------------------------------------------------------------------------

------------------------------------------------------------------------------
FIXED  SDSCM00034922
------------------------------------------------------------------------------

Summary            : Error message enumerating possible choices for option needs
		     spaces

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : C/C++ Compiler (cl)

Description: 
% cl470 --mvxx hello.c

error bad argument to option -mv should be one of {7R47M37A8645e}

%cl470 --float_support=xxx

error bad argument to option --float_support should be one of
{vfplibfpalibVFPv2VFPv3D16VFPv3}

------------------------------------------------------------------------------
FIXED  SDSCM00035000
------------------------------------------------------------------------------

Summary            : Compiler ignores #undef for a command line -D definition

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : C/C++ Compiler (cl)

Description: 
Take the following program tests.c

#undef foo
void foo(void)
{
}

Compile it with the C6x 7.0.0B4 compiler by

cl6x.exe -c --symdebugnone -dfoo=bar -mv6400+ --abi=eabi test.c

Display object file symbols by

nm6x.exe test.obj

The display is as follows

00000000 u
00000000 t .text
00000000 a 0276811
00000000 T bar

Obviosly the symbol foo has been renamed to bar, which should not 
happen.   The same issue pertains to the TMS470 compiler with EABI.

------------------------------------------------------------------------------
FIXED  SDSCM00035082
------------------------------------------------------------------------------

Summary            : Including math.h inside extern "C" gives errors

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Runtime Support Libraries (RTS)

Description: 
math.h is responsible for defining some overloaded functions when in
C++ mode, but it should not do so when included under an extern "C"
specifier.  This will cause compiler errors in C++ source

extern "C" { 
#include <math.h>
};

------------------------------------------------------------------------------
FIXED  SDSCM00035247
------------------------------------------------------------------------------

Summary            : The --exceptions option will cause conflicts with C files
		     in the RTS during link-time optimizer

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : ILinker (File Merge)

Description: 
The was a problem where the --exceptions option had the wrong option 
merging policy set. When combining multiple files for link-time 
optimization, we check to make sure all optionsets are consistent. The 
--exceptions option was mistkanely labeled as being required in all
input files.

------------------------------------------------------------------------------
FIXED  SDSCM00035269
------------------------------------------------------------------------------

Summary            : compiler generates ADR instruction with an invalid offset

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

Description: 
The compiler embeds constants in the .text section. It attempts to 
allocate all uses of a constant to a single definition, but sometimes
it is necessary to duplicate constants because of the limited range of LDR
and ADR instructions. This was a situation where constants were being 
duplicated, only to be found out they weren't needed. The compiler 
mistakenly wrote out these unneeded constants, pushing other constants 
out of range. This bug is most likely to be exposed when using -mf3 o 
higher with compiler release 4.7.0 or higher.

------------------------------------------------------------------------------
FIXED  SDSCM00035306
------------------------------------------------------------------------------

Summary            : The compiler may produce incorrect code when a static local
		     variable appears as part of an argument to a function call

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

Description: 
The compiler may produce incorrect code when a static local variable 
appears as part of an argument to a function call, when the same 
expression is used for that argument in all calls to that function, and
compilation uses -o3 optimisation.  There is a conflict between local 
statics and an aspect of -o3.

------------------------------------------------------------------------------
FIXED  SDSCM00035320
------------------------------------------------------------------------------

Summary            : Union initialization does not occur properly if the members
		     are declared in a different order when
		     using LTO

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

Description: 
The compiler attempts to accept two union types as compatible if their 
field members are in a different order. This is according to the C99 
standard. While, these types were indeed accepted as compatible, static
initialization of the union did not occur properly. The field
initialized was the first one in the first file that included that type. This 
has been fixed, and now initialization will occur as intended.

------------------------------------------------------------------------------
FIXED  SDSCM00035418
------------------------------------------------------------------------------

Summary            : Bitwise ops on memory access may go wrong if opASG in
		     register promotion

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

Description: 
OpASGs involving bitwise operations, especially &=, may compile 
incorrectly when used in a context in which the compiler wants to
promote a memory access to a register.	For example, "x.a.b &= k" when there
are several uses of x.a.b in the function;	the compiler will move x.a.b to
a register during the function and write it back at the end, but this 
problem may cause it to lose the "&= k" part.

------------------------------------------------------------------------------
FIXED  SDSCM00035422
------------------------------------------------------------------------------

Summary            : When building a relocatable executable, linker omits
		     relocation entries from the .debug_info section

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : COFF Linker

Description: 
When building a relocatable executable (-a -r) linker options, the
linker may omit some relocations from the .debug_info section. This can
inhibit debugging if the file is subsequently relocated.

This was caused because the linker used an incorrect value for the
DW_AT_location - this has now been fixed.

------------------------------------------------------------------------------
FIXED  SDSCM00035505
------------------------------------------------------------------------------

Summary            : Given a certain placement for .data, initialization data is
		     not relocated under EABI

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : ELF Linker

Description: 
The given linker command file exposes a linker issue that prevents the 
initialization data for the function pointer 'Tests' array from being 
relocated. Preliminary analysis indicates that a bug occurs when 
processing the output section '.app_ram_data'. 

------------------------------------------------------------------------------
FIXED  SDSCM00035558
------------------------------------------------------------------------------

Summary            : Fix shell memory allocation errors in the compiler shell

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Shell

Description: 
The shell could crash if the host OS were to run out of available heap 
memory.  The shell would not report any "out of memory" error.	

------------------------------------------------------------------------------
FIXED  SDSCM00035726
------------------------------------------------------------------------------

Summary            : Optimizer aborted with OUT OF MEMORY error.

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

Description: 
The problem arises when a loop that implements a MAX or MIN recurrence
is unrolled completely, and has enough iterations that the resulting 
expression that combines all the iterations is large.  Processing this 
large expression takes excessive time or space (or both).

------------------------------------------------------------------------------
FIXED  SDSCM00035817
------------------------------------------------------------------------------

Summary            : Optimiser takes too long on out-of-memory test case

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Optimizer

Description: 
The problem arises when a loop that implements a MAX or MIN recurrence
is unrolled completely, and has enough iterations that the resulting 
expression that combines all the iterations is large.  Processing this 
large expression takes excessive time or space (or both).

------------------------------------------------------------------------------
FIXED  SDSCM00035917
------------------------------------------------------------------------------

Summary            : GCC language extension allowing arithmetic on void*
		     pointers generates incorrect code

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Parser

Description: 
When using the --gcc option to allow GCC language extensions, the
ability to use void* pointers in arithmetic expressions is enabled.  
However, the genertated code will be incorrect.

------------------------------------------------------------------------------
FIXED  SDSCM00036144
------------------------------------------------------------------------------

Summary            : Disassembly incorrect for T2 BLX instruction

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : Disassembler (dis)

Description: 
Fixed an issue where Thumb-2 BLX instructions were disassembled with an
incorrect destination address.

------------------------------------------------------------------------------
FIXED  SDSCM00036371
------------------------------------------------------------------------------

Summary            : Address shell crash reports

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : Shell

Description: 
The shell may crash on Windows with an Microsoft error dialog
indicating a problem in ntdll.dll.  These crashes only occur on some PC's and 
seemingly at random.  The build of the shell has been changed that
should minimize the likelihood of these types of shell crashes.

------------------------------------------------------------------------------
FIXED  SDSCM00036527
------------------------------------------------------------------------------

Summary            : VFP registers popped in wrong order

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Code Generator

Description: 
This bug is caused when the VFP register POP instructions are emitted
in the same order as the PUSH instructions - they should actually be
emitted in the reverse order as the PUSh instructions. This is now fixed.

------------------------------------------------------------------------------
FIXED  SDSCM00036548
------------------------------------------------------------------------------

Summary            : Relocation entry is incorrectly evaluated to the beginning
		     of a section instead of the function symbol

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : Assembler

Description: 
This bug is caused when a thumb function, say foo,  is aligned on a 
halfword boundary. The caller of foo must be in the same file, in a
different section, and in ARM mode.  Additionally, there must be some
code above foo in the same section. This situation will cause the
assembler to generate an invalid relocation entry that will cause the
caller to branch to the beginning of foo's section instead of foo
itself.

------------------------------------------------------------------------------
FIXED  SDSCM00036601
------------------------------------------------------------------------------

Summary            : wmemchr is declared to return a const wchar_t*, but is
		     defined as returning a wchar_t*, which causes an error when 
                     using -o4

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : Runtime Support Libraries (RTS)

Description: 
The issue is caused by an incorrect prototype and definition of
wmemchr()

------------------------------------------------------------------------------
FIXED  SDSCM00036896
------------------------------------------------------------------------------

Summary            : Internal error on memcpy() used for value when optimization
		     is used

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Optimizer

Description: 
Using memcpy() for value, as in an IF predicate or under a dereference 
operator, can result in a compiler abort if the quantity copied is a 
single instance of a scalar or struct.

Note that the return value of memcpy() is the destination pointer; 
using it for value is not often useful.

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

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

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

Description: 

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.

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

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

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Code Generator

Description: 
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]

------------------------------------------------------------------------------
FIXED  SDSCM00036985
------------------------------------------------------------------------------

Summary            : Compiler generates a CRET instruction in an ARM function to
		     call a thumb function in the same file

Fixed in           : 4.7.0B3
Severity           : S3 - Minor
Affected Component : Code Generator

Description: 
This bug can occur if two functions in the same file are in different 
states, one in ARM the other in Thumb. If the ARM function qualifies
for tail call optimization, then its BL instruction to the Thumb function 
will be converted to a CRET (pseudonym for B) instruction. If the thumb
function happens to fall on a halfword boundary, the assembler will
issue an error.

------------------------------------------------------------------------------
FIXED  SDSCM00036986
------------------------------------------------------------------------------

Summary            : Preprocessor output files are created in incorrect
		     directory

Fixed in           : 4.7.0B3
Severity           : S2 - Major
Affected Component : Shell

Description: 
The shell option --pp_directory=dirname was added to allow user 
specification of the destination directory for preprocessor output 
files.	However, the default destination for these output files was 
accidentally changed in the process.  This fix restores the previous 
default behavior, specifically that the output file is placed in the
same directory as the source file.

------------------------------------------------------------------------------
FIXED  SDSCM00037009
------------------------------------------------------------------------------

Summary            : Left-shift by one less than signed type's size can compile
		     incorrectly

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

Description: 
The test case involved first contained a left shift of a signed int by
31.  This expression is undefined according to the C standard.	The
expression also contained a right shift of a negative signed int.  This
is implementation-defined according to the C standard. A legal
expression can be written as

S32 mask00 = ((S32)((U32)(mask[0] > 0) << 31) >> 31);

Perform an unsigned left shift, cast the result to signed and then
perform the right shift.  This gives the result you expect with an optimization
level less than -o3.	At level -o3, the optimizer does not sign extend the
right shift and reduces the expression to 1.	This is a bug, since the
implementation-defined behavior should be consistent in the tools.

Note that -o3 is relevant only in that it allows automatic inlining and
thus perturbs the code.  The key detail is the shift of 1 by 31 bits
and conversion to signed;  a smaller shift, or if there were no signed
types involved, and the problem would not occur.


------------------------------------------------------------------------------
6. Current Known Issues
------------------------------------------------------------------------------

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008203
------------------------------------------------------------------------------

Summary            : Assembler crash with wrong syntax in thumb asm code
Affected Component : Assembler

Description: 

The assembler will crash with the following wrong thumb syntax

BLT 0x8c

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008248
------------------------------------------------------------------------------

Summary            : Compilers on PC will not work without TMP set
Affected Component : C/C++ Compiler (cl)

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008251
------------------------------------------------------------------------------

Summary            : Printf format '%#04x' fills zeros into wrong location
Affected Component : Code Generator

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008276
------------------------------------------------------------------------------

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

Description: 

Linker accepts illegal address ranges and truncates to a valid address 
without any warnings.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008340
------------------------------------------------------------------------------

Summary            : directory name with '(' character causes linker error
Affected Component : Shell

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008410
------------------------------------------------------------------------------

Summary            : Assembler crashes when using constant operand to BEQ
Affected Component : Assembler

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008534
------------------------------------------------------------------------------

Summary            : Linker -xml_link_info option doesn't work when in a command
		     file
Affected Component : Linker

Description: 

The option --xml_link_info=file.xml does not work when it is
placed inside a linker command file.  

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008537
------------------------------------------------------------------------------

Summary            : assembler expression ~(0x80000000) evaulates as 0x80000000
Affected Component : Code Generator

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008543
------------------------------------------------------------------------------

Summary            : Forward reference in .space generates an internal error
Affected Component : Assembler

Description: 

If you attempt to assemble

 .space 0+a
b
a .set 1

the assembler will generate an internal error.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00008928
------------------------------------------------------------------------------

Summary            : Extern inline functions are not supported in the C/C++
		     Compiler
Affected Component : Parser

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00010718
------------------------------------------------------------------------------

Summary            : bad input causes ARM assembler to crash
Affected Component : Assembler

Description: 
Assembly file with bad input causes the assembler to crash

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00013456
------------------------------------------------------------------------------

Summary            : fgets in _IONBF mode does not respect size limit
Affected Component : Runtime Support Libraries (RTS)

Description: 
The second argument to fgets() is the maximum number of chars to read. 
In _IONBF mode, fgets() reads until end-of-line, potentially
overrunning the input buffer.  

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00014430
------------------------------------------------------------------------------

Summary            : calloc doesn't check arguments to make sure the requested
		     size is reasonable
Affected Component : Runtime Support Libraries (RTS)

Description: 
The function calloc() is required to return a pointer to memory
representing "nelem" copies of "size" bytes, or NULL if the request
cannot be satisfied.  However, for some values of "nelem" and "size"
(specifically when the result of nelem*size wraps around), calloc can
return a pointer to an object that is not large enough, rather than
NULL.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00018347
------------------------------------------------------------------------------

Summary            : No linker warning when input section alignment overrides
		     user specified alignment
Affected Component : Linker

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00018691
------------------------------------------------------------------------------

Summary            : Linker gives misleading warning when dot expressions used
		     in SECTION directive for .stack section
Affected Component : Linker

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00024879
------------------------------------------------------------------------------

Summary            : SIGSEGV on invalid mnemonic
Affected Component : Assembler

Description: 
asm470 crashes with SIGSEGV on invalid mnemonic starting "blea"

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00028902
------------------------------------------------------------------------------

Summary            : dem470 -n results in warning
Affected Component : Demangler (dem)

Description: 
dem470 -h lists -n as a valid option.
However, when
dem470 -n
is used, a warning is printed

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00031818
------------------------------------------------------------------------------

Summary            : Assembler does not accept optional 2 register format for
		     instructions which accept 3 registers
Affected Component : C/C++ Compiler (cl)

Description: 
In UAL the following are identical

ADD R0, R0, R1
ADD R0, R1

We do not accept this format for instructions.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00034000
------------------------------------------------------------------------------

Summary            : Linker command file math causes internal error
Affected Component : ELF Linker

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00035202
------------------------------------------------------------------------------

Summary            : SRS instruction accepts only one operand
Affected Component : C/C++ Compiler (cl)

Description: 
SRS instruction accaepts only one operand, although documentation says
otherwise .

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037170
------------------------------------------------------------------------------

Summary            : Embed does not handle cross-filesystem rename correctly
Affected Component : Embed Utility

Description: 
embed470 makes a call to rename() across filesystems without having a
fallback method (i.e. file copy).  If the /tmp directory is on a
different filesystem, the rename will fail, and embed470 will fail.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037399
------------------------------------------------------------------------------

Summary            : Linker (-o4) does not return error status on fatal assmbler
		     error
Affected Component : Linker

Description: 
When using -o4 (link time compile) linker does not return an error to
calling process when it terminates with an fatal error from the
assembler.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037466
------------------------------------------------------------------------------

Summary            : Certain MISRA warnings are incorrect
Affected Component : C/C++ Compiler (cl)

Description: 
For the code shown in the details, the MISRA warnings are incorrect. 
It appears the compiler is not considering all available information
when issuing the warnings.  Once this problem is better understood,
please update this description to include when the compiler may make
such errors.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037486
------------------------------------------------------------------------------

Summary            : The compiler reports a false violation of MISRA rule 9.3
Affected Component : Parser

Description: 
MISRA warning (MISRA-C2004 9.3/R) In an enumerator list, the '='
construct shall not be used to explicitly initialise members other than
the first, unless all items are explicitly initialised

In the following code we get MISRA 9.3 warning on COM_UNINIT = 0
assignment.

typedef enum

{
    COM_UNINIT = 0,
    COM_INIT

} Com_StatusType;

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037487
------------------------------------------------------------------------------

Summary            : The compiler reports a violation of rule 17.6 if the object
		     is a function pointer
Affected Component : Parser

Description: 
MISRA warning (MISRA-C2004 17.6/R) The address of an object with
automatic storage shall not be assigned to another object that may
persist after the first object has ceased to exist

typedef void (*FuncPtr)(void);

FuncPtr moduleFuncPtr;

static void test(const FuncPtr myFuncPtr)

{

    moduleFuncPtr = myFuncPtr; 
}

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037495
------------------------------------------------------------------------------

Summary            : Compiler reports a false violation of MISRA rule 12.1 if
		     array accesses are not included in
		     parentheses
Affected Component : C/C++ Compiler (cl)

Description: 

typedef struct
{
    uint8 myUint8;
    uint16 myUint16;
} MyTypedef_T;

MyTypedef_T myTypeArray[3]; 

static void test4(void)

{
    myTypeArray[0].myUint8 = 0U;    /* (MISRA-C2004 12.1/A) Limited
dependence should be placed on C's operator precedence rules in
expressions */

    (myTypeArray[0]).myUint16 = 1U; /* No MISRA 12.1 here */
}

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00037825
------------------------------------------------------------------------------

Summary            : ARM disassembler not outputting  thumb function symbol
		     labels for linked object files
Affected Component : Disassembler (dis)

Description: 
When given a linked thumb object file the ARM disassembler doesn't
output function symbol labels. For thumb function symbols the linker
will set the least significant bit as required by the ARM hardware to
denote a thumb function address. It appears that the disassembler is
not accounting for this when doing symbol lookup. See details to
produce a test case.

------------------------------------------------------------------------------
KNOWN ISSUE  SDSCM00038010
------------------------------------------------------------------------------

Summary            : Compiler fails to save the FPSCR in an interrupt function
		     when using VFP
Affected Component : C/C++ Compiler (cl)

Description: 
The FPSCR register is being modified in an interrupt function without
first being saved. The CPSCR does not need manual saving since it is
automatically saved by the hardware.
