- Important information
- New features
- Known problems
- Program corrections
- User guide corrections
- Miscellaneous
- Release history
Important information
Interrupts are disabled during hardware multiply operations.
Source code that was originally written for version 1.x of the MSP430 IAR C Compiler, can—with some modifications—also be used with the MSP430 IAR C/C++ Compiler included in this package. Please read the IAR Embedded Workbench for MSP430 Migration Guide for detailed information or the Step by step migration for instructions.
Source code that was originally written for earlier versions of the IAR C/C++ Compiler for MSP430, can—without any modifications—also be used with the compiler included in this package. We do recommend to take a look at the IAR Embedded Workbench for MSP430 Migration Guide for detailed information about the product changes.
ICC430 generates UBROF10 as debugger output object format. If an emulator which supports an earlier version of UBROF is used, XLINK must be forced to generate the appropriate UBROF format. To do this, select the correct UBROF format in the Output format drop-down list on the Output options page in the XLINK category.
When using the CLIB runtime library from the command line, the option
--clib
must be given.
Upgrade information
New features
C99 compliance
Compliance with the ISO C99 standard. Information about the effects of this change is available in the IAR Embedded Workbench for MSP430 Migration Guide__persistent
Global or static variables defined with the new attribute__persistent
will not be initialized by cstartup, but only by a code downloader or similar add-on functionality. See the IAR C/C++ Compiler Reference Guide for MSP430 for more information.__ro_placement
You can use the new attribute__ro_placement
in combination with the type qualifiersconst
andvolatile
to inform the compiler that a variable should be placed in read-only (code) memory. In earlier versions of the compiler this had to be done by not usingvolatile
and hiding the constant values from the compiler by plaing them in a separate source file. This is no longer needed. See the IAR C/C++ Compiler Reference Guide for MSP430 for more information.The IAR C/C++ Compiler Reference Guide has been updated.
Known Problems
EW21671: When
#pragma pack
is used, some expressions involving data placed in different memories, can cause the compiler to issue an internal error.EW21027, EW21028, EW21029: A DLIB library built for multi-threading will not work.
EW18569: A circular reference will cause the IDE to crash, for example:
#define LIST_SIZE (LIST_SIZE*(4+1))
EW15986: The compiler always puts a
nop
instruction after thedint
instruction in a__monitor
function even if it is not necessary.EW14296: If the
toupper()
function is used for instance with an incremented array index, such as:toupper(com[index++])
the array offset will incorrectly be incremented twice. All ctype functions evaluate their arguments twice or more, which is wrong. The following workarounds exist:1. Undefine the macro
toupper
, then a function call will be used instead.
2. Use parenthesis to force a function call,(toupper)(com[index++]).
3. Use the IAR DLIB Library which handles macro expansion correctly.
Program Corrections
5.10.1
EW21683: The RAM size for the device MSP430F477 has been corrected to 2 KByte in the linker command file.
EW21614: When compiling in multi-file compilation mode (
--mfc
), end-of-module diagnostic message (for instance, "variable was declared but never referenced") no longer cause an internal error.EW21542: The addresses of
UCB012COA
andUCB012CSA
in the fileio430x47x4.h
have been corrected.EW21418: The define
TAG_ADC12_1
has been changed from 0x10 to 0x08 in the header files.EW21319: A missing definition of
PxSEL2
has been added in the fileio430x21x2.h
.EW21308: The compiler could, in some cases, typically involving placement or
nothrow new
, emit a reference to a runtime library constant of the form__XXX_array_new_prefix_size
with an incorrect type, which could result in a type conflict warning or a range error when linking. This has been corrected.EW21299:
DMA1TSEL_7
andDMA1TSEL_8
have been corrected in the filemsp430x552x.h
.EW21282: A load from an object with known contents will no longer be replaced with the contents if the address expression has been cast to a pointer to volatile.
4.21.9 (patch release)
EW21513: In some rare cases irregular loops could be optimized incorrectly and the code in the loop could use uninitialized variables. This has been corrected.
EW21544: An assembler-level peephole rule that eliminated the use of a temporary register, was in rare cases applied even when it should not. This has been corrected.
4.21.6 (patch release)
EW21423: Multiplying a 32-bit value with a 16-bit value now works when the hardware multiplier is used with the option Allow direct access, and the 32-bit value is accessed via a pointer or a C++ reference.
User guide corrections
The corrections below refer to the PDF version of the user guide IAR C/C++ Compiler Reference Guide for MSP430, C430-8. The information in the PDF file is, in the event of any differences, more accurate than the printed reference guide and the online help files. The following issues have been addressed in version C430-8 of this guide: EW19761, EW20996, EW21281.
Nothing.
Miscellaneous
- Nothing.
Release history
4.21.2 2009-09-01
Program correctionsEW21269: On the 430X core, when the medium and large memory models was used, the intrinsic function
__delay_cycles
could clear the upper four bits of a processor register.EW21205: The code sequences for inline multiplication disabled interrupt too late to be fully interrupt safe. (This only affected applications where the hardware multiplier was used both in normal code and in interrupt service routines.)
EW21094, EW20687: The MISRA C:2004 rule number 10 is no longer triggered by Doxygen Documentation tags, for example:
/* * @} */
EW21062: In the large memory model on the MSP430X core, when using global dynamic initializers in C++, calling a function with a class parameter, and passing a temporary object, the function could, in some cases, be called with the wrong calling convention.
EW21003: A warning is issued then the function
__low_level_init
is defined unless the header fileintrinsics.h
has been included. When defining the function__low_level_init
in C++, an error is issued if it is not defined or declared using 'extern "C++"', as inintrinsics.h
.EW20999: JTAG Port Direction Birs has been corrected in the file
io430x54x.h
.EW20984: The compiler incorrectly accepted both the
--misrac1998
and--misrac2004
command line options at the same time.EW20982: The header file
msp430.h
no longer triggers any warning messages from the MISRA C checker.EW20981: The SFR
UCSCTL7
number of bits corrected to 16 in the header fileio430x54x.h
.EW20934: When using
#pragma pack
and copying data between objects in two different memories, or an object placed on the stack and one not, the internal error "[CoreUtil/General]: integral add" could be triggered. This has now been corrected.EW20932:
ADC12EOS, RTCNT12, RTCNT34
, andPMM
upper and lower bytes definitions have been added in the fileio430x54x.h
.EW20913: When using
#pragma pack
the internal error "[CoreUtil/General]: Unexpected basic type to size" could be triggered. This has now been corrected.EW20893: When using an auto array containing certain floating-point values, the compiler could appear to hang.
EW20839: When building the cstartup file, these symbols can be set to customize it:
IGNORE_SEG_INIT
-- To remove segment initialization
IGNORE_DATA16_DATA
-- To remove segment initialization ofDATA16
data
IGNORE_DATA20_DATA
-- To remove segment initialization ofDATA20
data
IGNORE_RAMFUNC_INIT
-- To remove segment initialization oframfunc
code
DISABLE_WATCHDOG
-- To disable the watchdog
Note: When using this feature to disable the watchdog, the preprocessor symbol representing the device used must also be defined.EW20816: In the file
io430G46x.h
file, enums are added forUSART1
modules.EW20806: When using C++ and device header files (or any located variable), multifile compilation did not work correctly.
EW20805: When using the 32-bit hardware multiplier, "long long" multiplication did not work correctly.
EW20793: A definition of
EOS
forADC12
has been added in the fileio430x54x.h
.
__ramfunc
The new extended keyword__ramfunc
makes a function execute in RAM. The code will be copied from flash memory into RAM by the startup code.When building the cstartup file, these symbols can be set to customize it:
IGNORE_SEG_INIT
-- To remove segment initialization
IGNORE_DATA16_DATA
-- To remove segment initialization ofDATA16
data
IGNORE_DATA20_DATA
-- To remove segment initialization ofDATA20
data
IGNORE_RAMFUNC_INIT
-- To remove segment initialization oframfunc
code
DISABLE_WATCHDOG
-- To disable the watchdog
Note: When using this feature to disable the watchdog, the preprocessor symbol representing the device used must also be defined.
v 4.20.1 2008-12-08
Program corrections- EW20647:
Some definitions for the
USCI
registers are missing in the filesmsp430x54x.h
andio430x54x.h
. - EW20634:
In the file
msp430x54x.h
some of theFLLUNLOCKxxxx
defines had wrong bits, this is now corrected. - EW20471:
Duplicate definition of
TAIV_TAIFG
has been removed from the fileio430x24x.h
. - EW20435:
UCB1I2COA
andUCB1I2CSA
have been changed fromchar
toshort
in the fileio430x24x.h
. - EW20365:
The address for
ME2
has been corrected. - EW20348:
Some register addresses have been corrected in the file
io430x26x.h
. - EW20313:
The compiler could crash when applying
#pragma pack
to a struct containing bitfields. - EW20312:
A problem that could cause an internal error in the compiler when
the C++ construct
reinterpret_cast
was used in a template has been corrected. - EW20262:
Some
DMA?TSEL
defines have been added in the fileio430x16x.h
. - EW20254:
The register
FWKEY
has been added to the fileio430x54x.h
. - EW20239: Incorrect code could sometimes be generated when accessing parts of volatile objects. Instead of accessing all bits in the object part, the code would only access a single bit. Typically, this would occur when using volatile in combination with bitfields.
- MISRA C:2004 support
IAR Embedded Workbench now supports automatic checking of source code for conformance to the MISRA C:2004 standard. - Multiple inheritance
Support for multiple inheritance has been added to the MSP430 compiler. - Improved hardware multiplier support
The compiler will generate code that accesses the hardware multiplier directly, when appropriate based on the optimization settings. Otherwise library calls will be made. It is also possible to always use library calls.
v 4.11E - patch release
- EW20300: A problem could occur for switch that used the intrinsic
fuction
__even_in_range
. If more than one switch was placed in the same compilation unit (source file) the compiler could incorrectly extract the "add to pc" instruction to a subroutine.
v 4.11C - patch release
- EW20226: The compiler could crash when
#pragma pack
was applied to a structure that contained a pointer. - EW20239: Incorrect code could sometimes be generated when accessing parts of volatile objects. Instead of accessing all bits in the object part, the code would only access a single bit. Typically, this would occur when using volatile in combination with bitfields.
- EW20240: A source file with a loop with a trivial body could, in rare conditions, trigger an "illegal state" internal error.
v 4.11B - 2008-07-10
Program corrections- EW20093:
The definition of port 7-10 in the file
io430xG46x.h
has been corrected. - EW20065:
When the option
--migration_preprocessor_extensions
was used, Misra C rule 97 was not checked. - EW20064: The symbols
EEI
andEEIEX
are now defined in the filesio430x47x3.h
andio430x47x4.h
. - EW20061: In some rare cases, post increment and decrement on pointers could be optimized incorrectly when the high optimization level was used. This has been corrected.
- EW20017:
The intrinsic function
__delay_cycles
, when used on the MSP430X core, triggered an internal error for certain input values. - EW19930: When the compiler recognized code that would swap the two bytes of a 16-bit value, and the value was placed on the stack frame, the compiler triggered the internal error "illegal state."
- EW19929:
An internal error is no longer generated if the intrinsic function
__data20_read_short()
is used together with the traditional MSP430 core. This intrinsic function is only useful together with a MSP430X core. - EW19888: In rare cases, the assembler-level optimizer could, when optimizing an instruction right before a switch statement, trigger the internal error "unexpected exception"
- EW19863:
The missing register
SWCTL
has been added to the fileio430xG42x0.h
. - EW19847: In some cases, the assembler-level peephole optimizer could incorrectly rewrite code when mixing byte and word accesses to the same location in memory.
- EW19789:
The registers
DMA0SZ
andDMA1SZ
are now defined in the fileio430x26x.h
. - EW19757:
In the linker command file
lnk430X.xcl
,HEAP
has been corrected toDATA16_HEAP
andDATA20_HEAP
. - EW19703:
Missing bits for port 7 and port 8 in the file
io430x26x.h
have been added. - EW19692: An internal error that could occur at some occasions when high speed optimization was used, has been corrected.
- EW19663: The compiler no longer causes an internal error when using a composite type that had already been diagnosed with an error.
- EW19646: The compiler no longer generates a faulty assembler instruction that refers to two symbols that were identical apart from uppercase and lowercase.
- EW19557:
The definitions of
SIFCTL4
andSIFDIV3
in the filemsp430xW42x.h
have been corrected. - EW18877: Some of the files
io430xxx.h
had a problem related to duplicate symbol definitions. This has been corrected. - EW18323: A compiler generated instruction that should refer to two symbols that are different by case only could be incorrectly generated referring to only one of them twice. This has been corrected.
- New compiler option
--segment
The command-line option--segment
can be used to rename segments or the base name of segment groups for memory types. The syntax is:--segment what=NEWNAME
Change the segment name. The parameter
what
can be one of the following:cstack
-- The run-time stackcode
-- Normal codeisr_code
-- Interrupt codeintvec
-- The interrupt vector tabledifunct
-- C++ dynamic initialization__data16
-- Base name for __data16 memory__data20
-- Base name for __data20 memory__regvar
-- Base name for __regvar variables
When using the
--segment
option from inside IDE Embedded Workbench, the Extra Options tab must be used. - Improved Hardware Multiplier support
Previously, hardware multiplier support was provided by letting the linker redirect calls to multiplication subroutines.The compiler can now generate code that uses the hardware multiplier directly. The following command-line options are provided:
--multiplier
or--multiplier=kind
. The parameterkind
can be one of the following:16
-- Traditional hardware multiplier.16s
-- The extended hardware multiplier used by some 2xx devices.32
-- 32-bit hardware multiplier.
--multiplier_location=HexAddress
. Thjis option specifies the location of the multiplier. For example, some 5xx devices need to use the option--multiplier_location=4C0
.
- Zero initialization of local array variables
A local array that originally was set to zero is initialized in a much more efficient manner, both in terms of speed and in terms of amount of read-only memory used.
V4.10D patch release
- EW19847: In some cases, the assembler-level peephole optimizer could incorrectly rewrite code when mixing byte and word accesses to the same location in memory.
- EW19777: Defining or using variables from different namespaces with the same name in one module could make the compiler crash or result in references to the wrong variable.
- EW19768: The common sub-expression elimination optimization could increase the code size if the code contained a lot of conditional expressions (e.g. questionmark-colon).
- EW19758: Access to a packed structure via a
data20
pointer could truncate the pointer. This problem only occurred in the medium data model for the MSP430X core.
V4.10B patch release
- EW19705, EW19693: Casts involving 20 bit types could, in rare cases, generate the following message: "Internal Error: ( CoreUtil/General): Wrong arity(1)". This has been corrected.
4.10A 2007-09-27
Program corrections- EW19557: The definitions of SIFCTL4 and SIFDIV3 in the file
msp430xW42x.h
have been corrected. - EW19465: Some
io430xxxx.h
files had incorrect definitions of port 1 and 2. - EW19433: In some cases, when placed inside an infinite loop,
the intrinsic function
__delay_cycles
could be optimized away. - EW19287: A problem related to Kanji letters in source file paths has been corrected.
- EW19238, EW18736: A problem has been corrected that could cause
the internal error, "illegal operand for low", to be triggered when
using the intrinsic function
__get_SR_register
,. - EW19218: The size of the RAM area for the device MSP430F2370 has been corrected to 2 Kbytes
- EW19182: Instantiating a template where the type of a non-type
template parameter depended on the type of a type template parameter
could cause an internal error in the compiler. For example:
template
struct X { T fun() { return x; } }; X sX; - EW19109: The reported problem has been corrected.
- EW19070: The devices msp430f1610, msp430f1611, and msp430f1612
have been added to the file
io430.h
. - EW18699: Nested loops with constant trip counts could be incorrectly optimized. Nested loops should now execute the correct number of iterations. .
- EW18677: The reported problem has been corrected.
- New data models for MSP430X
The concept of data models has been introduced for the MSP430X architecture. A medium and a large data model have been added to make it possible to access data above memory address 0xFFFF without using intrinsic functions. The small data model corresponds to the behavior in the 3.x compiler. For more information see the compiler reference guide. - Libraries built with previous versions of the compiler must be rebuilt to work with code generated with this version of the compiler.
- Changed calling convention
The calling convention has been improved. This affects applications written in assembler that are calling C functions. The old calling convention can still be used for assembler functions by specifying the keyword__cc_version1
. - A new option for control of the optimization level ,
-O
has been introduced. For more information see the compiler reference guide.
3.42A 2006-12-07
Program corrections- EW18609: An optimization can lift a global variable to a register in a code region. In some rare cases the register was not written back to the variable on all paths from the region. This problem has been corrected.
- EW18606: When using
MSP430X, monitor functions with stack parameters did not work. This has been
corrected.
- EW18594:
When a subroutine was extracted that included a
PUSH
, as well as code that referred to the new stack cell, the addressing mode offsets in the instructions became incorrect. This has been corrected.
- EW18368:
An internal error could be generated at very rare occasions when the operators
__segment_begin
and__segment_end
were used.
- EW18311:
The assembler-level peephole optimizer could lift
MOV
instructions, with the status register as destination, over conditional branches, overwriting the status bit that was tested. This has been corrected. - EW18197: The code that
would handle system termination could end up before the code for system
initialization. This has been corrected as it could confuse some debuggers.
- EW18136:
The runtime libraries responsible for multiplying two 16 bit numbers
into one 32 bit number internally used the
BR
instructions. If the destination address was placed too far from the branch instruction, the application failed to link. - EW17970:
The bit name
USIFGDC
(in theUSI
module) has now been corrected toUSIFGCC
inmsp430x2xxx.h
andio430x2xxx.h
.
- New generic header files
Two new generic header files,io430.h
andmsp430.h
has been added. These two files can be used when building from within the IDE and the correct device specific header file will automatically be included. A preprocessor define (the-D
option) will be used to identify the device.
3.41E 2006-06-08 (patch release)
- EW18131: In some rare conditions, the
AND.B
andAND.W
instructions could be removed even though they were needed.
3.41C 2006-05-12 (patch release)
- EW18040: In some cases, the compiler would handle register
R15 incorrectly when the internal library functions
?Mul16to32s
and?Mul16to32u
were used. - EW18017: When the MSP430X core was used, function pointer calls (when the actual destination address is a known integer value) could cause the compiler trigger an internal error.
3.41A 2006-04-13
Program corrections- EW17958: In rare cases, instructions that performed zero-extension,
AND.B #0xFF, Rn
, could be removed by the peephole optimizer. (This could occur if the register later was used in an indirect or post-inc addressing mode in byte instructions.) - EW17928: The compiler can transform simple if-else-statements into straight code that computes the result rather than using traditional test-and-branch code. This transform is no longer performed on low optimization levels since it makes the code harder to debug.
- EW17892: Memory accesses through
__segment_begin()
or__segment_end()
could incorrectly be removed as dead code. - EW17887: In some cases high speed optimization could cause a loop
to execute one extra iteration, if:
- the loop had a constant trip count,
- the loop was expressed as a while (true) loop, and
- the loop exit was handled by a condition and a break statement in the middle of the loop body with non-dead code both before and after the break.
- EW17860: Code that swapped two bytes could, in rare conditions, cause
an internal error. This has been corrected.
- EW17849: An error message will now be given if you try to place a
located variable above address
0xffff
. - EW17818: The compiler could arbitrarily generate an internal error on
medium or higher optimization levels.
- EW17751: A constructor with a statically initialized local variable no
longer generates an internal error.
- A new intrinsic function
__delay_cycles
provides cycle accurate code size minimized delay functionality. - A new pre-processor symbol
__POSITION_INDEPENDENT_CODE__
has been added.
3.40C 2006-01-30 (Patch release)
- EW17729: An internal error could be generated on high optimization levels when the optimization resulted in dead code.
3.40B 2006-01-27 (Patch release)
- EW17725: In some rare cases the optimizer incorrectly transformed
a for or a while loop to a do loop if:
- the loop test compared the loop counter to variable (V) that was invariant in the loop, and
- the loop was preceded by an if-else-if-statement where the else-if-test tested V against a constant value.
- EW17720: The binary search with compare switch algorithm did not work properly.
- EW17649: The compiler could hang when there were volatile read/write operations inside a loop.
- EW17638: An internal error was generated when the
#pragma bis_nmi_ie1
directive was used.
3.40A 2005-12-19
Program corrections- EW17522: A word access on
R4/R5
by the__set_R4/R5_register
instrinsic function could earlier incorrectly be changed to a byte access if used with inline assembly. - EW17287: Accesses to
struct
orunion
members declaredvolatile
could earlier incorrectly be removed as dead code if:
- the member was declared
volatile
but thestruct
orunion
was not and - the member offset in the
struct
orunion
was 0.
- the member was declared
- EW17250: The
VLDx
bit definitions for theSVSCTL
register is no longer missing in the header filemsp430f16x.h
and in the filemsp430f167.sfr
. - EW17246: On high optimization levels, the compiler could sometimes consume unnecessary large amounts of time and memory.
- EW17205: In the default link files, the RAM end addresses were one byte too large. This has now been corrected.
- EW17126: In some rare cases, assignments could incorrectly be hoisted
out of the loop if the loop body contained a test of a variable (
V
) andV
was assigned a constant value later in the loop body. - EW17124: An Internal Error could occur when high optimization was used.
- EW17001: The register renaming optimization could sometimes rename
too many occurences of a register. For example, if the optimization
tried to rewrite the two instructions
MOV R12, R14
andMOV.B @R14, R14
into the single instructionMOV.B @R12, R14
the result instead becameMOV.B @R12, R12
. (This instruction, of course, will be subject to other optimizations, for example dead code elimination.) - EW17000: An internal error could occur if identical infinite loops were found and they were extracted into a subroutine.
- EW16921: A problem, where a global variable was placed in a register and not written down before the global was read again, has been fixed.
- EW16909: The linker warning "more than one definition for struct/union type" was earlier incorrectly displayed when an I/O definition header file was included and more than one SFR was referenced from C++ source code.
- Support for the MSP430X architecture
IAR Embedded Workbench for MSP430 now supports the MSP430X architecture. The MSP430X architecture provides an extended memory range up to 1 Mbyte and an extended instruction set. Note that the support for the MSP430X architecture is in beta status until the first MSP430X devices are released to market. Select Generic MSP430X device in the Device list to generate code for the MSP430X architecture. -
You can now compile several source files in one compilation by specifying the command line option
--mfc
. The advantage of multi-file compilation is that it gives the interprocedural optimizations a larger set of functions to work on. If you also specify the command line option--discard_unused_publics
, the optimization will be further improved because the compiler will assume that there are no references to any symbol from the outside in the compilation, that is the compilation unit is the whole application apart from the library.
Note: Use the--mfc
option with caution, it is experimental in this version of the compiler. - The added predefined preprocessor symbols
__SUBVERSION__
and__BUILD_NUMBER__
, in the compiler and the assembler, denote the subversion, that is the 'C' in 4.21C, and the build number, respectively. The build number is a number that does not necessarily increase with a later released compiler or assembler, that is use it only in equality or inequality preprocessor expressions. -
It is now possible to declare variables in the initialization clause of a
for
statement, but only in extended language mode. This behavior is according to the C99 and the C++ standards. -
Some more C99 functionality has been added to the IAR DLIB Library:
Ctype.h
definesisblank
as an added function.Inttypes.h
has been added. Note that only the conversions are included, not the functions.Math.h
defines the following additions:
- Macros -
HUGE_VALF, HUGE_VALL, INFINITY, NAN, FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, MATH_ERRNO, MATH_ERREXCEPT, math_errhandling
. - Typedefs -
float_t, double_t
. - Macro functions -
fpclassify, signbit, isfinite, isinf, isnan, isnormal, isgreater, isless, islessequal, islessgreater, isunordered
.
- Macros -
Stdlib.h
definesllabs, lldiv, strtoll, strtoull, atoll, strtof
, andstrtold
as added functions.Wchar.h
definesvfwscanf, vswscanf, vwscanf, wcstof
, andwcstolb
as added functions.Wctype.h
definesiswblank
as an added function.
3.30B 2005-06-16
Program corrections- EW16547: An optimization that tries to hold a global variable in a register during several modifications of the global could in some cases cause incorrect code.
- EW16618: Corrected a problem where, if
-
1) the address of an auto struct (x) was passed as a argument to a function call,
2) a member (m) of x was used in the same expression (to calculate the function address or in another function argument), and
3) x.m was assigned immediately before the call - EW16621: In some rare cases, values were not written to memory before a function call.
- EW16809: Loop idiom recognition could cause an internal error.
- EW16879: At optimization level high incorrect code could be generated if a loop had an unsigned loop counter, the loop counter was decremented, and the loop contained a test (besides the loop exit test) where the loop counter was compared to zero.
- EW16888: If a loop with a variable upper limit was preceded by a
modification of the upper limit and a test of the upper limit being larger
than the lower limit of the loop, the optimizer could incorrectly assume that
the loop body should always be entered.
if (u > 0)
{
--u;
for (i = 0; i < u; ++i)
{
...
}
}
3.30A 2005-04-18
Program corrections- EW16162: Volatile accesses to non-byte objects could earlier, in some situations, be performed using byte accesses. In this release, volatile accesses to objects larger than a single byte are performed using 16 bit operations.
- EW16321: The write-back from the return value registers to a variable located on the stack was sometimes removed on the highest optimization.
- EW16346: In rare cases, inside special kinds of loops, inline assembler statements could be removed.
- EW16527: The error
Internal error: [CoreUtil/General]: Illegal operand for low
could occur, in some rare cases, when a value was accessed via a pointer and the result was used in a comparison. - EW16641: An internal error could occur when the optimization "loop unrolling" was used.
- A number of new optimizations has improved both code size and execution speed.
- The 64-bit floating point support has been dramatically improved regarding both size and speed especially when the HW multiplier is used.
- A new option
--reduce_stack_usage
has been added. This option will force the compiler to clean up the stack more frequently at the cost of a bit larger and slower code. - Support for compound literals has been added to the C language.
3.21A 2004-10-20
Program corrections- EW15428: If one of the ready made I/O definition files is used, and an additional include file is specified using an absolute path that includes a drive letter equal to one of the status register bits (C, N, V, or Z) defined in the I/O definition file, the compiler would replace the drive letter with the defined bit number and the file would not be found.
- EW15799: Structure assignments involving at least one auto variable and a struct member of a large struct could cause an internal error.
- EW15821: A problem has been fixed where, in rare cases, the assembler level optimizer incorrectly optimized memory accesses inside loops.
- EW15871: Multiplication of long long's did not work when the hardware multiplier was enabled.
- EW15942: The compiler produced different (but correct) output on different PCs.
- EW16054: The definition of
U0TXBUF
was incorrect inmsp430x16x.h
.
- The 32-bit floating point support is now even faster especially when the HW multiplier is used.
3.20A 2004-06-18
Program corrections- EW15085: The use of the
__ALIGNOF__
operator in a preprocessor construction in conjunction with the option--migration_preprocessor_extensions
caused the compiler to generate errors incorrectly. - EW15370: Remarks were incorrectly generated when compiling an empty file within the IAR Embedded Workbench.
- EW15461: A test on a
volatile
declared variable could in some cases fail on optimization level 4 or higher. - EW15481: Incorrect code could be generated for packed structures on optimization level 6 or higher.
- The option
--core
has been added to include support for 128-Kbyte devices. The support for 128-Kbyte memory also includes a new memory type attribute__word16
. - New more optimized 32-bit floating-point libraries. The compact math library version for IAR CLIB has been removed from the product as the new floating-point libraries are even more compact.
- Two new intrinsic functions have been added to set and get the value of the
stack pointer,
__set_SP_register()
and__get_SP_register()
. - A new pragma directive
bis_nmi_ie1
has been added. It will generate aBIS.W #xx,IE1
instruction right before theRETI
instruction at the end of the function, after any POP instructions. The effect is that NMI interrupts cannot occur until after the instruction in question and that less stack will be used in the case of nested interrupts. - A new intrinsic function
__even_in_range()
has been included to provide a way to generate optimal code for switch statements where you know that only even values within a given range are possible. This is useful, for example, in an interrupt service routine for the TAIV Interrupt Vector Generator. - The following C99 features can now be used in the C
language if language extensions (-e) are enabled:
- The
inline
keyword. It works as the C++ inline keyword (and the#pragma inline
declaration). - Mixing declarations and statements within the same scope.
- Having a declaration in the initialization expression of a for-loop.
- The
- A new object attribute,
__noreturn
, has been added. The attribute can be used on functions to inform the compiler that the function will not return. The compiler can then generate more efficient code. Example of functions that do not return areabort()
andexit()
. - The MSP430 IAR C/C++ Compiler Reference Guide has been updated.
3.10A 2004-03-05
Program corrections- EW14579: A function that was inlined was incorrectly removed by an optimization.
- EW14882: Equal comparison of floating point numbers was not working correctly when position-independent code was used.
- EW14993: An attempt to optimize two similar function calls failed on the highest size optimization level.
- New optimizations have been implemented to make the generated code even more compact.
- C++ support is now available also in the standard MSP430 IAR Embedded Workbench package.
- Extended EC++ adds the
following C++ features that are not part of the EC++ standard:
- Templates. The template design accommodates memory attributes in an efficient
way. They adhere to the C++ standard except for not supporting the export keyword.
- Standard Template Library. The collection classes can be placed in any suitable memory and they are optimized for a small memory footprint.
- Class memory, i.e. a class type has an associated memory attribute. This
enables the placement of a class in any suitable memory.
- Namespace support.
- C++ cast variants static_cast<>, const_cast<>, and reinterpret_cast<> are supported.
- Mutable is supported.
- Templates. The template design accommodates memory attributes in an efficient
way. They adhere to the C++ standard except for not supporting the export keyword.
- Some ISO C99 features have been added. They are available when language extensions are
enabled and apply to both CLIB and DLIB (library related functionality apply only when using
the DLIB library):
- Support for the bool data type, if the header file
stdbool.h
has been included. - _Pragma support. This operator works as the pragma directive and can be used in macro definitions.
- Variadic macro support. You can now write printf-style macros.
- Hexadecimal floating point constants support. This means the ability to
exactly specify a floating point constant. The functions strtod(), printf(),
and scanf() recognize the syntax.
- The macro definition __func__. If used in a function, it is defined to the name of the function.
- Designated initializers. Using these, you can initialize a specific element in a structure or a specific element in an array.
- Inline functions. The pragma directive
inline [= forced]
has been added as well. - Long long support in the library. For example the functions strtoll(), strtoull() have been added as well as support for them in printf() and scanf().
- Support for the bool data type, if the header file
- More optimized and configurable C/EC++ library
The C/EC++ libraries now come in two variants, normal and full. Each variant can be further customized to reach an optimal balance between functionality and size. To allow even more detailed tuning of the libraries, the library source and a template project is available to make it easy to build a customized C/EC++ library. - Extended keyword __regvar
It is now possible to permanently place a variable in a register. The new extended keyword__regvar
will place a variable in register R4 and/or R5. Note that the compiler options--reg_var_r4
and/or--reg_var_r5
must be used to reserve the registers. - Extended keyword __raw
The extended keyword__raw
has been added. It can be used to prevent a interrupt function from preserving the content of all used processor registers at the entrance and from restoring them at exit. Note that this is only useful for some very special applications.
2.21B-P1 2003-12-16
- EW14715: A loop that accesses a volatile variable could make the compiler hang on optimization level medium and high.
2.21B 2003-11-21
- EW14603: The compiler could hang and never return when a loop with accesses to volatile declared variables was compiled. This problem only occured on the optimization levels medium and high.
- EW14646: The right hand side of a compound assignment (+=, *=, etc.), or a simple assignment that could be transformed to a compound assignment, could in some rare cases be incorrectly eliminated as a common subexpression.
2.21A 2003-10-17
Program corrections- EW14180: The #pragma optimize directive was erroneously diagnosed as not applicable when defining a member function of a class.
- EW14311: A problem related to return from switch-statments has been corrected.
- EW14395: In some rare cases, complex pointer expressions that modifyies a pointer variable close to a use of the same variable could cause an internal error.
- EW14398: If loop optimization could hoist all C code out of a loop, the loop could be eliminated even though it still contained an asm statement. This has been corrected.
- EW14420: In some cases optimization of casts from a floating-point type to a signed integral type and then to an unsigned integral type was too aggressive. Casting the floating-point value directly to the unsigned type produced incorrect result for negative values.
- EW14469: The return sequence for interrupt functions was not handled correctly when position-independent code was used.
- EW14475: Interrupt service routines could earlier get unnecessary push/pop instructions even at the highest optimization when some intrinsic functions were used within the routine.
- EW14554: It was not possible to change the heap size by adding the heap.c file to the project.
- The library functions that performs signed and unsigned long division have been improved.
- A more efficient 32*32-> 64 bit multiplication has been implemented. It is
important that correct variable types are used. This can be acompliched in
the following way:
unsigned long long mul(unsigned long x, unsigned long y) { return ((unsigned long long)x) * y; }
- The compiler generates more efficient code for multiplications when one of the factors is a known constant.
- Additional new optimizations have been added.
2.20A-P030708 (patch release) 2003-07-08
- EW14137: Writing to an SFR could in some situations not be handled correctly by the compiler.
- EW14155: Arithmetic expessions could be transformed incorrectly if the result was masked with 0x01, for example (x + 1) & 0x01.
- EW14164: A test inside a loop with contant start and stop values could in previous versions be transformed to an unconditional jump if the test was made on the least significant bit of the loop counter.
2.20A 2003-05-23
Program corrections- A
NOP
instruction has been added after theDINT
instruction in the intrinsic funtion__disable_interrupt
. - EW13767: In some cases a pointer incrementation or decrementation could be performed as a postincrement or postdecrement in the previous statement, even if the statement had multiple accesses through that pointer and execution of the postincrement or postdecrement affected the other accesses. This has been corrected.
- EW13863: An alignment problem has been corrected for the type
jmp_buf
used by the functionssetjmp
andlongjmp
. - EW13943: A problem has been corrected where an internal error could be generated for complex expressions containing casts from the address of a variable to an int.
- Support for 64-bit floating point numbers (doubles).
- Support for the
long long
integer data type, for more information see User guide corrections. - Support for position-independent code.
- Intrinsic functions that can be used for adding two BCD coded numbers have been added. For more information see User guide corrections.
2.10A-3 2003-03-20
- EW13735: The supplied source for
cstartup
was not the right one.
2.10A 2003-02-28
Program corrections- EW13554: Shift with a known number of steps on a variable in memory did not work, in some cases. The problem occured for 32 bit objects that where placed in memory and shifted exactly 8 steps (for all shift variants). In addition, for unsigned right shift, if the step count was 24 to 30.
- Embedded C++ support
The new MSP430 IAR Compiler supports C and optionally Embedded C++ for the Texas Instuments MSP430 microprocessor family. The compiler is based on the latest IAR compiler technology and replaces previous versions of the MSP430 IAR C Compiler. A simple click in the options dialog box will give you access to a true object-oriented language that is well suited for embedded applications. Embedded C++ is a subset of C++, in which some of the more costly parts of the C++ language have been removed. Embedded C++ support is only included if you have purchased an Embedded Workbench EC++ product. - A number of new optimizations now makes the compiler generate even more compact code for either speed or size.
- A fully IEEE754-compliant floating point library is now included in the product.
- New compiler options and intrinsic funtions has been added to this version. See the MSP430 IAR C/EC++ Compiler Reference Guide for more information.
2.09B 2003-01-31 (beta version)
- CFE0013: The following code:
case 1: if (0) default: p += 3;
erroneously deleted the default label. Complex logical expressions where one or more conditions where known constants or redundant nested switch statements could cause different types of problems. - EW12430:
When the following expression was compiled:
while (FCTL3 & 0x01);
an 8-bit access was generated on a 16-bit register. - EW12893: The new intrinsic function _SWAP_BYTES was missing in the in430.h file.
- EW13388: The compiler did in some cases not distinguish between a volatile pointer and a pointer pointing to a volatile variable/value.
- EW13399: The stack pointer was not restored correctly in the cstartup.s43 file, causing two bytes to be wasted on the stack.
- EW13400: When subtracting a constant value from a long variable, the compiler could give wrong results on optimization level High.
- EW13401: The Embedded Workbench closed down unexpectedly during compilation of a file with a comment with many '*' characters that had lost it's first '/' character.
1.26B 2002-10-11
- EW12055: A
function-pointer expression that involved a comma expression generated
erroneous code or a crash of the compiler.
- EW12097: A for loop could in some cases be entered when the condition was false. This happened if the size optimization was medium or higher but has now been corrected.
- EW12141:
An internal error was generated in the function get_reg_ind_P20 on the following code:
long *lmmpa = (long *)0; (*lmmpa++) &= 3;
The problem occured when SP was used in indexed addressing mode. - EW12221: When a local
variable was declared inside a block within a function, it could occur that
the variable was placed on an odd address on the stack.
1.26A 2002-03-11
- None.
1.25A 2001-11-09
- New optimizations:
1) while(1) { } Old assembler code: New code: ?1: MOV #1h,Ry ?1: JMP ?1: CMP #0,Ry JNE ?1: 2) while(1) { statement; } Old assembler code: New code: ?1: MOV #1h,Ry ?1: statement ... CMP #0,Ry JMP ?1: JEQ ?2: statement ... JMP ?1: ?2: 3) More effective code, when writing as follows: i /= 2, i /= 4, i /= 8, i /= 16, i /= 32, i /= 64 and i /= 128. i /= 128 only if the speed optimization flag is set.
- Three new intrinsic functions: _BIS_SR_IRQ and _BIC_SR_IRQ, to change the SR register on the stack, within interrupt service routines (ISR). _BIS_NMI_IE1, to change the interrupt enable control bits 1 (IE1, address 0x0000), within a NMI service routine, the BIS.B instruction is placed before the RETI instruction.
- A new option -ua, to enable odd address check. It is not possible to read a word from an odd address.
- C00016
The code:
void func_pointer(void);
#define FUNC func_pointer
&FUNC-1,
caused an internal error. This has now been corrected. - C00017
Copying a structure to another, using pointers, corrupts one of the structure pointers. This has now been corrected. - C00018
Internal error when using the keyword asm:
asm ("BIC 010h,0(SP)").
No asm instruction available, the compiler now generates the error: "No asm-keyword available". - C00020
The optimizer corrupted local pointers at higher optimizations than -s6, when decrementing more than twice. This has now been corrected.
1.24A 2001-04-06
- Optimizations:
Old assembler code: New assembler code: MOV Rx,Ry MOV @Ry,Rx MOV @Rx,Rx
- The option -re (Generate source file embedded in object file) is now available from the IAR Embedded Workbench.
- A new option -upic, to receive position-independent code except function
pointers. With the option -ufp, function pointers will be position-independent.
To use both options, write -upicfp. Use the libraries cl430_pic.r43 or cl430m_pic.r43. Position-independent code will generate more code, particularly function pointers.
1.23A 2000-10-16
- Optimizations:
Old assembler code: New assembler code: MOV &1,Rx AND #XX,Rx MOV Rx,&1 BIC #~XX,&1
- Multiply with 3 and 5 is generated respectively as, 2*val+val and 2*val+2*val+val, no library call. Also when writing X *= 3, X *= 5 and X *= 9, more effective code without library calls will be generated.
1.22E 2000-06-26
- Updated with the latest compiler front end.
- C00014
A NOP instruction has been added after the DINT in the hardware multiply library functions. This has been done to ensure a non-interrupted load of the multiplier registers.
1.22A 1999-11-25
- C0013
Optimization level 3 now generates fully debuggable code. - C0012
Earlier versions incorrectly accepted absolute bit syntax. Such syntax is not supported by the ICC430 compiler and now generates an appropriate error message.
1.20A 1999-02-19
- C0008
Calling a function via a function pointer on the stack used an incorrect stack offset. This type of call was done inside printf. This has been corrected. - C0009 Static register variables were always saved on function exit even if they had not been modified. This has been corrected.
- C0011
Problem that could cause Internal Error "scan-if - X06 : null pointer" is now corrected. - Support for MSP430 11X series microcontrollers is included with the sfr include file io11x.h.
- The bit definitions for the TCCTL register in the other io.h files are removed since same bit names are located in different positions in other registers.
1.11A 1997-09-11
- Support for MSP430 330 series hardware multiplier has
been added in the new library 'cl430m.r43'. All devices can use the standard
library 'cl430.r43', multiplications are then emulated.
The 'cl430m.r43' library protects the hardware multiplier from maskable interrupts. This implies a longer interrupt latency during multiplications.
Avoid multiplications and indexing arrays of non-scalar elements when writing non-maskable interrupts in C if the 'cl430m.r43' library is linked. - C0005
The condition test 'if (uint - 42 == 0)' was performed with 'CMP.B'. This has been corrected to 'CMP'. - C0006
Writeback of static char variables at a function epilogue was performed with 'MOV'. This has been corrected to 'MOV.B'. - C0007
Illegal optimization for assignments of type 'uint = uchar;' has now been removed.
1.10C 1997-02-28
- Incorrect offsets were used when passing auto variables as arguments to functions:
PUSH @SP was used to transfer stack top, should be PUSH 2(SP)This problem did not show when (1) passing the two leftmost arguments, since they go in registers and (2) when the passed value is a register variable. [Report D970218A]
1.10B 1997-01-15
- Register parameters were not saved to stack when compiling with option -rr (no register variables). This has been corrected.[Report D961210A]
- Incorrect data definition directives were used in the assembler list file. This has been corrected.
- Post-increment addressing mode is now better utilized.
- XLINK now supports the MSP430_TXT format, which is
used in Texas Instruments' Starter Kit/Evaluation Kit. To generate this format
use XLINK option:
-Fmsp430_txt
-f stk430.xcl
1. ChooseProject>Options
2. Select the XLINK category.
3. On the output page, select the format Other and choose msp430-txt from the drop-down list.