Please contact support for more information about this release.
Enhancements in ARM Compiler 5.04 update 5
General enhancements
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .
Defect fixes in ARM Compiler 5.04 update 5
Compiler (armcc)
[SDCOMP-29633]When a
static variable in an inline function or an inline class member function has a section attribute, this attribute was ignored and the variable was placed in a section with a different name from the name given by the attribute. This could also cause anInternal fault . This has been fixed.[SDCOMP-29544]In certain circ*mstances, when compiling at
-O3 -Otime , the compiler could incorrectly assume that the values of elements in a multi-dimensional array would not change from their initial values. This could result in incorrect code. This has been fixed.[SDCOMP-29543]In certain circ*mstances, when compiling at
-O3 -Otime , the compiler could incorrectly fail to sign extend the return value for a function that returns a signed integer when the expression receiving the returned value is of a wider integer type. This has been fixed.[SDCOMP-29542]In certain circ*mstances, when compiling at
-O3 -Otime , the compiler could incorrectly treat the result of an equality operator or a relational operator asunsigned int instead ofint . This has been fixed.[SDCOMP-29464]In rare circ*mstances, when compiling at
-O1 or above, the compiler could generate a sequence of code that incorrectly used a flag-setting instruction, corrupting the flags required by a subsequent flag-reading instruction. This has been fixed.[SDCOMP-29304]In rare circ*mstances, when compiling at
-O2 or above, the compiler could generate incorrect code when the result of an arithmetic expression containing a bitwise Exclusive OR and a bitwise OR operator is assigned to a variable of integer type that is smaller than a 32-bit integer. This has been fixed[SDCOMP-29280]In rare circ*mstances, when compiling at
-O1 or above, the compiler could generate incorrect code when a location in memory is written to without usingvolatile followed by another write to the same location that does usevolatile . This has been fixed.[SDCOMP-29267]In rare circ*mstances, when compiling at
-O2 or above, the compiler could incorrectly optimize an expression involving two operators that are either:- Both bitwise OR.
- Both bitwise Exclusive OR.
- A combination of bitwise OR and bitwise Exclusive OR.
This has been fixed.
[SDCOMP-29261]In rare circ*mstances, when compiling for Thumb state, the compiler could generate incorrect code for a program that reads from a number of contiguous memory locations where it can be determined that some of the reads can be eliminated. This could result in a failure to load some of the required data. This has been fixed.
[SDCOMP-29252]In rare circ*mstances, when compiling at
-O2 or above, the compiler could incorrectly allocate variables local to a block of code to the same memory locations as variables outside of the block of code. This has been fixed.[SDCOMP-29222]In rare circ*mstances, when compiling for ARM state, the compiler could generate incorrect code for calculating offsets to data stored in contiguous memory locations. This could result in a value being written to or read from an incorrect address. This has been fixed.
[SDCOMP-29191]In rare circ*mstances, when compiling with
-Otime at--vectorize -O2 or above, the compiler could generate incorrect code when vectorizing a loop that writes to an array. This has been fixed.[SDCOMP-29189]In rare circ*mstances, when compiling with
-Otime at--vectorize -O2 or above, the compiler could generate incorrect code for a loop that casts the elements of an array of integer type tofloat to perform a floating point calculation, and the result is cast back to an integer type for further calculations. This has been fixed.[SDCOMP-29160]In certain circ*mstances, when compiling at
-O3 -Otime , the compiler could generate incorrect code for afor loop that modifies a pointer which aliases the loop index. This could result in an incorrect number of iterations of the loop. This has been fixed.[SDCOMP-29158]In rare circ*mstances, when compiling at
-O3 -Otime , the compiler could generate incorrect code for a program containing nestedfor loops, resulting in an inner loop body incorrectly being executed. This has been fixed.[SDCOMP-29157]In rare circ*mstances, when compiling at
-O3 -Otime , the compiler could generate incorrect code for expressions of the formA & B when one ofA orB can be evaluated at compile time to zero and the other expression contains an increment or decrement operator. This has been fixed.[SDCOMP-29155]In rare circ*mstances, when compiling at
-O3 -Otime , the compiler could generate incorrect code when a parameter of a function is always passed the same value, and the value is not in range of the type of the parameter. This has been fixed.[SDCOMP-29151]In rare circ*mstances, when compiling at
-O3 -Otime , the compiler could generate incorrect code for a control statement having a controlling expression of the formA <= B orA > B , where expressionA can be evaluated at compile time to zero andB is of an unsigned type. This has been fixed.[SDCOMP-29117]In rare circ*mstances, when compiling at
-O2 or above, the compiler could generate code containing execution paths that do not have correctly balancedPUSH andPOP instructions. This could corrupt the stack, resulting in incorrect behavior. This has been fixed.
Libraries
[SDCOMP-29102]The C library function
strftime() would generate incorrect results when using the%C or%h format specifiers. This has been fixed.
Other issues
[SDCOMP-29337]In certain circ*mstances, the compiler could incorrectly generate
Error: C9558E: System clock tampering detected. License checkout will fail. if files with very old timestamps were present in the file system. This has been fixed.
General changes in ARM Compiler 5.04 update 4
[SDCOMP-28484]The control of license management warnings has been improved:
- The
and--diag _remark options can now be used to downgrade all license management warnings.--diag _suppress - The
option now upgrades all warnings except for license management warnings to error severity.--diag _error=warning
- The
Enhancements in ARM Compiler 5.04 update 4
General enhancements
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .
Defect fixes in ARM Compiler 5.04 update 4
Compiler (armcc)
[SDCOMP-29257]In certain circ*mstances, the compiler could produce incomplete debug information for data that is allocated to registers rather than memory. This has been fixed.
[SDCOMP-29030]At
-O3 -Otime , in rare circ*mstances the compiler could generate incorrect code for expressions of the formA relational-operator B when bothA andB are of integer type and have known values at compile time. This has been fixed.[SDCOMP-29029]At
-O3 -Otime , in rare circ*mstances when compiling afor loop that has an iteration variableX whereX is of signed integer type, has an initial value that is not known at compile time, and that may overflow the value range for its type, the compiler could generate incorrect code that fails to enter the loop body for all the expected initial values ofX . This has been fixed.[SDCOMP-29028]At
-O3 -Otime , in rare circ*mstances when compiling anif statement having a controlling expression that can be evaluated to false at compile time, the compiler could generate code which incorrectly failed to execute function calls contained in the controlling expression. This has been fixed.[SDCOMP-29026]At
-O3 -Otime , in rare circ*mstances when compiling afor loop that has an iteration variableX whereX is of signedchar or signedshort type, has an initial value that is known at compile time, and that may overflow the value range for its type, the compiler could generate incorrect code that fails to enter the loop body. This has been fixed.[SDCOMP-28950]When compiling for Thumb state at
-O2 or above, the compiler could generate aMULS instruction between a flag-setting instruction and a conditional instruction, resulting in incorrect behavior. This has been fixed.[SDCOMP-28895]At
-O3 -Otime , the compiler could generate incorrect code for a function that is inlined into the body of a loop when the function contains a local array variable with an initializing expression. This has been fixed.[SDCOMP-28669]When compiling for ARM state at
-O2 or above, in rare circ*mstances involving a conditional expression the compiler could report anInternal fault . This has been fixed.[SDCOMP-28651]In certain circ*mstances, the compiler could generate incorrect code for a chained
struct orclass assignmentx = y = z resulting in the rvalue expression,z , being evaluated more than once. This has been fixed.[SDCOMP-28552]At
-O2 and above, in rare circ*mstances the compiler could generate incorrect code when compiling nested conditional expressions or statements involving variable assignments. This has been fixed.[SDCOMP-27405]When compiling for Thumb state, the compiler could generate incorrect code when explicitly or implicitly adding, subtracting, or comparing to an integer constant and that constant cannot be directly encoded in the immediate field of an
ADD orADDS instruction. This has been fixed.[SDCOMP-25836]At
-O3 -Otime , in rare circ*mstances a combination of optimizations could result in an incorrect transformation, causing the compiler to report anInternal fault . This has been fixed.[SDCOMP-25725]When compiling for Thumb state at
-O3 , in rare circ*mstances involving many expressions the compiler could report anInternal fault . This has been fixed.
Linker (armlink)
[SDCOMP-26071]When resolving a relocation to a linker-generated
Load$$ symbol, if RW data in one or more preceding execution regions is compressed, the linker could incorrectly calculate that value of the symbol. This has been fixed.
Libraries
[SDCOMP-28672]The
std::deque::operator++() andstd::deque::operator+=() methods implemented indeque anddeque.cc contained errors that could load data from memory beyond the area allocated for thedeque . This could result in a Data Abort. This has been fixed.[SDCOMP-28636]The
std::vector::operator=() method implemented invector.cc contained an error that could result in incorrect behavior when the size of the destination vector is larger than the size of the source vector. This has been fixed.
Other issues
[SDCOMP-28980]When preprocessing a scatter-file using ARM Compiler 5.04 update 3 (build 146), the link step could require two compiler licenses concurrently. This has been fixed.
General changes in ARM Compiler 5.04 update 3
[SDCOMP-25859]ARM Compiler 5.04 update 3 includes FlexNet Publisher 11.12.1.0 client libraries. This version of the license client is not compatible with previous versions of the FlexNet Publisher license server software:
- ARM Compiler 5.04 update 3 will report
FLEXnet Licensing error:-7,10015 when used with a license server running anarmlmd orlmgrd version earlier than 11.12.1.0. - A license server running
armlmd andlmgrd version 11.12.1.0 (or later) is compatible with ARM Compiler 5.04 update 3 and all previous releases of ARM tools.
FlexNet Publisher 11.12.1.0 (or later) license server software can be downloaded from https://silver.arm.com/browse/BX002 (login/registration required).
- ARM Compiler 5.04 update 3 will report
Enhancements in ARM Compiler 5.04 update 3
General enhancements
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .
Defect fixes in ARM Compiler 5.04 update 3
Compiler (armcc)
[SDCOMP-26023]In certain circ*mstances, the compiler could report an
Internal fault when compiling code containing NEON intrinsics. This has been fixed.[SDCOMP-25946]At
-O2 and above, in certain circ*mstances the compiler could generate a sequence of code that incorrectly contains a flag-setting variant of an instruction rather than the non flag-setting variant. This could result in a subsequent branch instruction having incorrect behavior. This has been fixed.[SDCOMP-25900]At
-O3 -Otime , the compiler could generate incorrect code for a loop that contains onlyif statements with bodies that are never executed and are either empty or contain only abreak orcontinue statement. This has been fixed.[SDCOMP-25894]At
-O1 and above, when reading a bitfield of typelong long orunsigned long long from astruct that has been declared packed using any of__attribute__((packed)) ,#pragma pack(n) , or the__packed qualifier, and the code is not compiled for unaligned accesses, the compiler could generate code that loaded data from memory beyond the end of thestruct . This has been fixed.[SDCOMP-25845]The compiler could generate incorrect code for a chained
struct assignment if the left-hand side of the assignment is avolatile variable and the right-hand side is another assignment expression that does not involve an assignment to or from avolatile variable. This has been fixed.[SDCOMP-25830]The compiler could generate incorrect code for a copy assignment of a
struct that contains both non-volatile andvolatile bitfields. This has been fixed.[SDCOMP-25811]When using
to downgrade error messages to warning severity, the compiler could incorrectly fail to generate an object file even though it returned a zero exit code. This has been fixed.--diag _warning=error[SDCOMP-25761]At
-O2 and above, in certain circ*mstances the compiler could generate incorrect code when integer constant values with the same binary representation are used in two different expressions, and the first of these expressions includes a logical Exclusive OR. This has been fixed.[SDCOMP-25753]At
-O3 -Otime , when a loop contains two pointers that point to the same array and contains a sequence of statements that read from and/or write to the array through these pointers, the compiler could incorrectly reorder these statements. This has been fixed.[SDCOMP-25643]When processing embedded assembly language that contains a constant string of length greater than 128 characters, the compiler could incorrectly report
Error: A1154E: Unexpected operand, operator expected . This has been fixed.[SDCOMP-25575]The compiler could generate incorrect code for accesses to a
volatile bitfield member of astruct where the bitfield container is narrower than the bitfield container type but wider than one byte. This has been fixed.[SDCOMP-25485]When compiling with
-Otime at--vectorize -O2 or above, a loop that copies an array of structures in decreasing address order could be incorrectly transformed by the compiler into a copy by increasing address order. This could result in incorrect behavior when the source and destination memory areas overlap. This has been fixed.[SDCOMP-25347]At
-O3 -Otime , when a function declares and initializes two variablesA andB , the initialization ofB calls a functionF() with an argument that depends onA , and the initialization of both variables involves a call to avirtual member function or function pointer, the compiler could incorrectly generate two calls toF() . This has been fixed.[SDCOMP-25117]At
-O2 and above, the compiler could generate incorrect code when assigning a pointer dereference to a variable, then setting the location that was dereferenced to a different value, and then using both the variable and the new value of the pointer dereference in the same expression. This has been fixed.[SDCOMP-25085]At
-O3 -Otime , the compiler could generate incorrect code for afor statement in which expression-3 performs an array copy. This has been fixed.[SDCOMP-25034]The compiler could generate incorrect code for a function call with a 64-bit integer argument that is read from a
struct declared within the scope of a#pragma pack(2) or a#pragma pack(4) . This has been fixed.[SDCOMP-25005]When compiling for an ARMv7-M target at
-O3 -Otime , the compiler could generate incorrect code for a--loop_optimization_level =2while loop in which the controlling expression post-increments a variable that is used to index an array in both the controlling expression and the loop body. This has been fixed.[SDCOMP-24936]At
-O0 , the compiler could generate incorrect code for certain relational expressions containing an operand that is a bitwise AND of along long expression and a large constant with exactly one bit set. This has been fixed.[SDCOMP-24897]When compiling an assignment in which the operands are of
struct orclass type and the right operand contains avolatile unnamed bitfield of size0 , the compiler would either fail with anInternal fault or would generate incorrect code. This has been fixed.[SDCOMP-24711]When a bitfield member of a
struct is declared with thealigned(n) attribute havingn greater than1 , and either that bitfield or thestruct is packed, thealigned(n) was incorrectly treated as if it werealigned(1) . This has been fixed.
Assembler (armasm)
[SDCOMP-25862]When assembling the
MSR instruction for an ARMv7-M processor, the assembler did not recognize the_<bits> qualifier for theIAPSR ,EAPSR , andXPSR registers. This has been fixed.
Libraries
[SDCOMP-25856]When computing the complex inverse sine of a real number strictly between
-1 and1 , thecasin() ,casinf() , andcasinl() library functions would incorrectly return the imaginary part of the result as NaN instead of0 . This has been fixed.
Enhancements in ARM Compiler 5.04 update 2
General enhancements
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .
Defect fixes in ARM Compiler 5.04 update 2
Compiler (armcc)
[SDCOMP-24893]At
-O3 -Otime , the compiler could generate incorrect code for a loop containing a post-incremented variable. A pre-increment operation would be generated instead of a post-increment operation, which could cause incorrect loop behavior. This has been fixed.[SDCOMP-24747]In certain circ*mstances the compiler could crash when compiling C++ code with the
option. This has been fixed.--protect_stack [SDCOMP-24731]When using the inline assembler with a quoted string construct, for example,
__asm("MOV a, b"); , the preprocessor would preprocess the assembly code inside the string by mistake. This has been fixed.[SDCOMP-24730]At
-O1 and above, when compiling an integer divide expression for an ARMv7-M target, the compiler could generate incorrect code that may result in a fault when run with trapping of divide by zero enabled. This has been fixed.[SDCOMP-24675]If a pointer to a class A, pointing to an object of a class B indirectly derived from A, was cast with
dynamic_cast to a class C from which B was also derived and from which A is not derived, then the compiler could incorrectly remove some information from the output object file. This would cause the linker to delete the Run-Time Type Information (RTTI), and would make thedynamic_cast fail with a runtime type check failure. This also applied to references as well as pointers. This has been fixed.[SDCOMP-24655]At
-O1 and above, the compiler could miscompile a sequence of code in which a variable was incremented by a constant value and was then used in a conditional expression in which it was decremented by the same, constant value. This has been fixed.[SDCOMP-24526]In some circ*mstances, the compiler could generate incorrect code for reading and writing packed
long long bitfields. This has been fixed.[SDCOMP-24520]In certain situations when compiling for Thumb-2 and involving closely chained comparisons, such as computing
abs(x) and immediately comparing it with another value, the compiler could mistakenly generate aSUB instruction rather than a flag settingSUBS instruction. This could result in incorrect behavior. This has been fixed.[SDCOMP-24506]If a value was stored in a local variable with an integer type smaller than four bytes using a
__strt ,__strex , or__swp intrinsic, the compiler could generate code that failed to sign-extend or zero-extend subsequent reads of that variable when required to do so. This has been fixed.[SDCOMP-24493]At
-O2 and above, in certain situations involving a sequence of loads or stores to a contiguous area of memory, the compiler could generate anLDM ,STM ,VLDM , orVSTM instruction with an uninitialized or incorrectly initialized base register for part of the sequence. This has been fixed.[SDCOMP-23837]At
-O2 and above, in some circ*mstances the compiler could incorrectly transform aCMP instruction followed by an instruction that tests for aMI orPL condition by changing the condition fromMI toPL , or vice-versa, and swapping the order of theCMP operands. This would lead to incorrect behavior where theCMP operands are equal, or differ by0x80000000 . This has been fixed.
Linker (armlink)
[SDCOMP-24101]When linking a program using
,--rwpi ,--ropi ,--fpic , or the--reloc PI orRELOC attributes in the scatter-file, the linker could incorrectly insert two bytes of padding between a veneer and a subsequent scatter-loading handler. When using the option, the padding bytes would be set to the--pad value and this could result in an arbitrary or undefined instruction being executed. This has been fixed.--pad [SDCOMP-24054]To generate correct veneers, the linker must first finalize the order of the sections within an execution region. In rare circ*mstances, when linking a large program, the linker could incorrectly change the order of the sections after veneers had been inserted. If an inline veneer was created for a section that was subsequently moved, incorrect behavior would occur whenever that veneer was called because execution would transfer to a different section than the one that was expected. This has been fixed.
Libraries
[SDCOMP-23977]When initializing an object of type
std::priority_queue using the constructor that takes onlyCompare andContainer arguments, the library code failed to callmake_heap . This would result intop returning values in an incorrect order. This has been fixed.[SDCOMP-23881]Use of a
%*n directive in a scanf-family function would behave the same as%n , instead of doing nothing as C90 requires. This has been fixed.[SDCOMP-23765]When the
%[ conversion specifier for a scanf-family function fails to match any input characters, the corresponding argument should be unaffected. Instead, the argument would have had'\0' written to its first byte. This has been fixed.
Enhancements in ARM Compiler 5.04 update 1
General enhancements
[SDCOMP-23838]Support for the Cortex-A17 CPU has been added. To target the Cortex-A17 select from the options:
with NEON and VFP support.--cpu =Cortex-A17 with no NEON and no VFP support.--cpu =Cortex-A17.no_neon.no_vfp
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .
Defect fixes in ARM Compiler 5.04 update 1
Compiler (armcc)
[SDCOMP-23768]At
-O2 and above, in rare circ*mstances the compiler could generate an incorrect sequence of stores for assignments to data members of astruct orclass . This has been fixed.[SDCOMP-23761]At
-O3 -Otime , an expression of the form(c/-a) , wherec has the valueINT_MIN anda has the valueINT_MAX , could be wrongly transformed leading to an arithmetic overflow. This has been fixed.[SDCOMP-23760]At
-O3 -Otime , when unrolling a nested loop with constant loop limits and increments which read from a global variable, the compiler could generate code that failed to reproduce the effects of all loop iterations. This has been fixed.[SDCOMP-23685]At
-O2 and above, the compiler could optimize certain expressions involving two consecutive loads from the samevolatile location as though the two loads were guaranteed to return the same value. This has been fixed.[SDCOMP-23642]At
-O2 and above, if an lvalue was conditionally set to a constant and subsequently shifted by another constant when being compared against a value known to be a constant, then the comparison was incorrectly performed as though the shift was not present. This has been fixed.[SDCOMP-23582]At
-O1 and above, if an element of a string literal was accessed through anunsigned char pointer and the element had the top bit set then its value
would be wrongly sign-extended. This has been fixed.[SDCOMP-23551]At
-O1 -Otime and above, compiling a conditional expression((e%M)? T : F) with constantM ,T andF would generate an internal fault if the expression was nested twice in the condition of an expression or once in the condition of anif statement. For example:((((e%M)? T : F)? T1 : F1)? T2 : F2)
or:
if ((((e%M)? T : F)? T1 : F1){ .. }
This has been fixed.
[SDCOMP-23494]The compiler could report internal fault
0x87ecef when compiling an anonymous namespace that contained a type definition that needed a virtual table. This has been fixed.[SDCOMP-23386]At
-O3 -Otime , when the condition of anif statement contained an expressionA[c1][c2] , whereA was an array ofstruct elements declared with a constant initializer, andc1 andc2 were constants, internal fault0x2d15b6 could occur. This has been fixed.
Assembler (armasm)
[SDCOMP-23935]When using
with two or more separate--cpreproc -I options, the assembler would fail to correctly pass the include directories to the compiler, resulting in errorA1905U . This has been fixed.
Enhancements in ARM Compiler 5.04
Compiler (armcc)
[SDCOMP-23470]The data flow analysis diagnostic
C4017: <entity> may be used before being set is now suppressed by default at all optimization levels. It can be enabled using .--diag_warning =C4017[SDCOMP-22700]Options have been added for controlling the generation of literal pools and branch tables. Disabling literal pools and branch tables will avoid the compiler placing data in code sections, either by placing data in data sections or synthesizing constants in line. The default is to generate all the literal pools and branch tables. The new options are:
/--integer_literal_pools --no_integer_literal_pools /--float_literal_pools --no_float_literal_pools /--string_literal_pools --no_string_literal_pools /--branch_tables .--no_branch_tables
Libraries
[SDCOMP-22595]The library functions
__rt_sdiv32by16 ,__rt_udiv32by16 and__rt_sdiv64by32 have been deprecated.
General enhancements
[SDCOMP-23478]Implemented
as a compiler option. Within the line table, entry to an inlined function is indicated by--debug_info =line_inlining_extensionsDW_LNE_lo_user and exit from an inlined function is indicated byDW_LNE_lo_user+1 .[SDCOMP-23370]The ARM Compiler now supports the invocation of a sub-process when the current working directory is a Windows UNC path. The sub-process invocations affected by this change are:
armcc callingarmlink orarmasm armasm callingarmcc armlink callingarmcc
[SDCOMP-23344]ARM Compiler 5.04 has changed the version strings reported by
armar ,armasm ,armcc ,armlink , andfromelf . These now display three-part messages of the form:Product: ARM Compiler 5.04 Component: ARM Compiler 5.04 Tool: armcc [5040027]
The Product string reflects the product that the toolchain is a component of, for example DS-5 or ARM Compiler 5.04. The Component string reflects the version of ARM Compiler that is being used. Tool provides a unique identifier for the specific tool being used.[SDCOMP-23284]Support for execute-only memory regions when building for ARMv7-M has been added to ARM Compiler 5.04. For more information on using this functionality, please see the ARM Compiler documentation.
[SDCOMP-23283]ARM Compiler 5.04 adds support for:
- Windows 8 (64-bit)
Support has been deprecated for:
- Ubuntu 10.04 LTS (32-bit) platform.
Cygwin support (32-bit platforms only), moves to Cygwin version 1.7.25.
[SDCOMP-22083]The future ARM Compiler 5.05 feature release will deprecate support for the following host platforms:
- Windows Server 2003 (32-bit)
- Red Hat Enterprise Linux 5 (32-bit and 64-bit)
Defect fixes in ARM Compiler 5.04
Compiler (armcc)
[SDCOMP-23465]At
-O3 -Otime , the compiler could replace simple array initialization sequences withmemset and then expand this inline in a way that caused incorrect code generation. This has been fixed.[SDCOMP-23413]At
-O3 -Otime , in some circ*mstances the compiler could unroll a loop but miscalculate changes to loop variables, leading to incorrect code being generated. This has been fixed.[SDCOMP-23317]When compiling with
, the compiler could crash if the second or later input file used numeric labels in inline assembly. This has been fixed.--multifile [SDCOMP-23297]If a local, non-static object was initialized with a constructor taking the result of calling
new , using the formatT obj(new S()) , and control passed out of the object's scope because of a thrown exception, then the object's destructor would not be called. This has been fixed.[SDCOMP-23265]At
-O3 -Otime , a loop with a constant but odd number of iterations would be unrolled twice with a single iteration lifted out of the loop. The compiler would fail to preserve the dependencies in the sequence lifted out of the loop, leading to incorrect results. This has been fixed.[SDCOMP-23264]At
-O3 -Otime , a loop initializing an array from the loop counter followed by a loop that used the array would be combined into a single loop. Because of incorrect changes to the array references, the new loop was not equivalent to the original code. This has been fixed.[SDCOMP-23263]When compiling with
, the compiler could crash if the second or later input file used a--multifile NOP instruction in inline assembly. This has been fixed.[SDCOMP-23237]At
-O0 only, a conditional expression that tests bit 31 of a 64-bit integer could be miscompiled, leading to incorrect results. This has been fixed.[SDCOMP-23136]If there was a write to a bitfield (for which the compiler has to generate a read-modify-write sequence) that occurred after a call to
memset() in an if-else block, the compiler could move the read of the bitfield container to before thememset operation, resulting in an incorrect value being written to the bitfield container. This has been fixed.[SDCOMP-23039]Objects that use section flags which are not defined by the ABI are no longer marked as ABI-compliant.
[SDCOMP-23023]When compiling with
, the compiler could crash if the second or later input file used instructions with more than one operand in inline assembly. This has been fixed.--multifile [SDCOMP-23016]At
-O3 -Otime , when compiling code containing two distinct loops operating on an array of union type, where the first loop is writing to it, and the second is reading from it, the compiler would merge the loops and move the reads before the writes. This resulted in incorrect behavior at run-time. This has been fixed.[SDCOMP-23015]At
-O3 -Otime , the compiler could unroll a loop with a small, constant limit but fail to detect all uses of the iteration variable. This behaviour could lead to incorrect code being generated. This has been fixed.[SDCOMP-23013]At
-O3 -Otime , if a local integer variable was accessed and incremented through a pointer within a loop, and the accessed values were summed, the compiler could generate incorrect code. This has been fixed.[SDCOMP-23011]At
-O3 -Otime , an invalid transformation could be applied to an expression of the form(INT_MIN / -INT_MAX) that appeared in the condition of anif statement. This has been fixed.[SDCOMP-23010]At
-O3 -Otime , the compiler could miscalculate an integer expression involving large integer constants when trying to simplify the condition in anif statement. This has been fixed.[SDCOMP-23009]At
-O3 -Otime , the optimization of a loop involving variables ofchar orshort type could wrongly promote the variables to typeint , leading to unexpected results. This has been fixed.[SDCOMP-23007]At
-O3 -Otime , the compiler could miscalculate the comparison of a constant againstINT_MIN , leading to incorrect results. This has been fixed.[SDCOMP-23006]At
-O3 -Otime , in a loop that contains a write to a variable that is also read through a pointer, the wrong value could be read. This has been fixed.[SDCOMP-23005]At
-O3 -Otime , when unrolling simple, nested loops with assignments to array elements, the compiler could incorrectly remove some of the assignments. This has been fixed.[SDCOMP-23004]At
-O3 -Otime , a loop that contains a conditional assignment, which also assigns a constant to a variable in its initialization, could cause the compiler to generate incorrect code. This has been fixed.[SDCOMP-23003]At
-O3 -Otime , a for-loop beginning atINT_MIN could be incorrectly unrolled into a conditional statement guarded by an expression that would overflow. This has been fixed.[SDCOMP-23002]At
-O1 and above, a call tomemset on a small, global array could be expanded inline in a way that caused invalid code analysis, leading to incorrect code being generated. This has been fixed.[SDCOMP-23001]At
-O3 -Otime , if a multi-dimensional array was initialized with a sparse list, the compiler could wrongly make assumptions about the value of the uninitialized elements. This has been fixed.[SDCOMP-22995]At
-O3 -Otime , the compiler could fail to terminate when compiling aswitch statement with an empty body. This has been fixed.[SDCOMP-22994]When compiling under Windows at
-O3 -Otime , the compiler could use the wrong value forINT_MIN in some integer expressions. This would typically happen when simplifying conditionals or transforming loops when the expressions involved integer limits. This has been fixed.[SDCOMP-22993]At
-O3 -Otime , if a pointer to a loop counter variable was dereferenced after the loop, the compiler could generate code that incorrectly returned the value of the counter before the loop. This has been fixed.[SDCOMP-22992]When compiling under Windows at
-O3 -Otime , some arithmetic operations involvingINT_MIN could cause the compiler to stop with an integer overflow fault. This has been fixed.[SDCOMP-22884]The compiler could incorrectly transform code that stores the address of a
struct to a member of thatstruct , resulting in code that stores the address of the member. This has been fixed.[SDCOMP-22879]At
-O3 -Otime , the compiler could ignore thevolatile qualifier on a field of astruct orunion . This issue would only occur if all accesses were indirect, such as by reading thestruct orunion as a single object. This has been fixed.[SDCOMP-22770]The compiler could incorrectly translate
x <= y wherex was anint and the difference betweenx andy was greater than the largest non-negativeint . This has been fixed.[SDCOMP-22760]Code generated to access a bitfield with base type
long long could sometimes produce a corrupted value or access the wrong memory location. This has been fixed.[SDCOMP-22712]When a
long long ordouble was passed as an argument to a function, such that its stack offset exceeded the maximumLDR immediate offset for the target instruction set, the value of that argument could be incorrect. This has been fixed.[SDCOMP-22538]At
-O1 and above, when a function withrestrict pointer arguments was inlined this could cause incorrect code generation in the inlined-into function. This has been fixed.[SDCOMP-22511]In certain situations assigning to the dereferenced pointer result of an inlined function at
-O3 -Otime could cause internal fault0x87ecef . This has been fixed.[SDCOMP-22486]At
-O3 -Otime , the compiler could incorrectly choose a vectorized version of the code when copying--vectorize char data toshort data via overlapping pointers. Additionally, the compiler could incorrectly transform a decrementing loop into an incrementing one in the non-vectorized version of the code. Both issues have been fixed.[SDCOMP-22471]The compiler could generate inefficient code when assigning to a
struct containing at least onevolatile member. This has been fixed. When appropriate, the compiler now usesmemcpy for non-volatile members.[SDCOMP-22376]The function attribute
__attribute__((weakref)) was not marking references to the aliased function as weak. This has been fixed.[SDCOMP-22337]The compiler could report internal fault
0xe35e83 when compiling C++ code with exceptions enabled at-O3 . The cause of this internal fault has been fixed.[SDCOMP-22321]At
-O3 -Otime , when optimizing a loop involving a floating point calculation, the compiler could generate an intermediate variable of typeint . This variable is used to store a floating point value, leading to an incorrect calculation due tofloat toint type conversion truncating the value and discarding the fractional part. This has been fixed.[SDCOMP-22301]The compiler will now report error
3094 if__stack_chk_guard is wrongly defined as code rather than data, and error3095 if__stack_chk_fail is wrongly defined as data rather than code.[SDCOMP-19892]The option
did not work correctly on files containing a mixture of initialized and uninitialized file-scope variables. This has been fixed.--no_data_reorder [SDCOMP-18315]The compiler could generate inefficient code when assigning to a
class containing at least onevolatile member. This has been fixed. When appropriate, the compiler now usesmemcpy for non-volatile members.[SDCOMP-11964]In some circ*mstances, a report of error
137: expression must be a modifiable lvalue would wrongly be accompanied by a report of warning1441-D: nonstandard cast on lvalue . This has been fixed.
Assembler (armasm)
[SDCOMP-22554]The assembler would previously not create
IT blocks for conditionalMSR instructions on M-profile cores, and would incorrectly generate an unconditional instruction. This has been fixed.
Linker (armlink)
[SDCOMP-22938]When an execution region containing compressed RW data has the same load and execution address, the linker must decompress the compressed RW data to a temporary area of memory before overwriting the compressed RW data. The linker no longer uses memory described by execution regions with both
EMPTY andUNINIT attributes for this purpose.[SDCOMP-22483]The linker will no longer produce internal fault
0x3d9eed when processing debug information relating to an unused__thread variable.[SDCOMP-22246]The following issues with the
option have been fixed:--feedback_image - When using
none ornoerrors :- The linker would crash when the address of a
FIXED region overlapped another - Errors relating to the
.ANY scatterfile selector were not downgraded (L6406E ,L6407E ) - Errors relating to possible scatterloading corruption were not downgraded (
L6788E ) - Errors resulting from
ScatterAssert expressions were not downgraded (L6388E ).
- The linker would crash when the address of a
- When using
simple :- bitband regions were not supported and resulted in error
L6191E __at sections would result in an error if the address overlapped with an address already in the default scatter-file.
- bitband regions were not supported and resulted in error
- When using
[SDCOMP-22145]The linker will no longer produce virtual function elimination errors when trying to link an invalid C++ program with missing symbols. The linker will now produce errors about the missing symbols.
[SDCOMP-20307]When using
the scatter file--paged FILL andPADVALUE attributes incorrectly behave as thoughEMPTY ZEROPAD had been specified. This has been fixed.[SDCOMP-19471]The linker would not define all necessary linker defined symbols when linking with
, which could lead to error--feedback_image =simpleL6218E . This has been fixed.[SDCOMP-18236]The linker would compute the results of
LoadBase andLoadLimit functions inScatterAssert expressions relative to the execution region base rather than the load region base. This could result in missing or spurious assertion errors. This has been fixed.[SDCOMP-17693]If the
$Sub and$Super mechanism was used to write a wrapper for a C library function for which there are multiple implementations, the linker could select the wrong variant of that function from the library for the$Super version. The list of affected functions is long, but includes the multithreading and realtime heap versions ofmalloc , and the multitheading versions of any of the high-level I/O functions. This has been fixed.[SDCOMP-17034]The linker could break section placement ordering rules by inserting a veneer after a zero-sized data section. This has been fixed.
[SDCOMP-13661]When an
OVERLAY region was followed by two incorrectly overlapping execution regions, the linker failed to report errorL6221E . This has been fixed.[SDCOMP-11735]The definition of
Image$$ execution region symbols has changed. For an execution region calledER the symbolsImage$$ER$$Base ,Image$$ER$$RO$$Base ,Image$$ER$$RW$$Base ,Image$$ER$$ZI$$Base ,Image$$ER$$Limit ,Image$$ER$$RO$$Limit ,Image$$ER$$RW$$Limit , andImage$$ER$$ZI$$Limit now include padding inserted by the linker to align theBase andLimit of the RO, RW and ZI section representing the execution region in the ELF file. This change has been made so that the behavior of theImage$$ symbols with respect to padding matches theLoad$$ symbols.The behavior of
has been fixed. All ELF sections are now compliant with the section alignment requirements of the ELF specification. Previously only the base and file offset of the first ELF section representing the execution region was aligned to the execution region alignment.--no _legacyalignThe behavior of the scatter file
ALIGN keyword when used with has changed. The alignment of the execution region is the value defined by the--no _legacyalignALIGN directive, or the input section alignment requirement if greater. Previously the value defined by theALIGN directive would be used instead of the input section alignment.