- Important information
- New features
- Known problems
- Program corrections
- User guide corrections
- Miscellaneous
- Release history
Important information
Read the IAR C/C++ Compiler Reference Guide for CR16C for detailed information about this product component.
In previous versions, the keyword
__huge
was provided for backward compatibility, as an alias for__data24
. With the introduction of the Huge data model, this keyword is no longer defined.
New features
-
Parallel build
IAR Embedded Workbench can now build projects using multiple parallel processes. This can improve build performance significantly on multi-core or multiple processor computers. To enable parallel build, select Tools>Options>Project>Enable parallel build.
Known Problems
-
The compiler generates incorrect function debug information for the output format UBROF-8.
[EW21128]
Program Corrections
-
Living code is removed on Size High optimization level.
[EW24634]
User guide corrections
- None.
Miscellaneous
-
The size of the two C standard types size_t and ptrdiff_t is always 32 bits. Technically, this is a violation of the standard for the small data model, where they should have been of size 16. The reason for this is to let applications handle larger pointers and objects than default. A concrete example is that this allows sizeof to be applied to objects larger than 64Kbytes.
-
The supplied runtime environment (cstartup etc.) assumes that the application will be executed in supervisor mode and not in user mode. This means that the user stack pointer is not initialized and that the processor is not switched to user mode before the main function is called. The reason is that if user mode is to be used, some kind of operating system is needed, and this is not included in this product.
Release history
V3.20 - 2013-06-12
-
New data model
A new Huge data model is implemented, where the default memory type is data32. -
New command line option
The new command line option--segment
controls the naming of segments generated by the compiler. -
New intrinsic functions
Theintrinsics.h
file provides the type__istate_t
and the functions__get_interrupt_state
and__set_interrupt_state
to save and restore the interrupt state.
-
The compiler erroneously removes
#pragma message
texts when the--silent
option is used.
[EW22200] -
The compiler does not treat
#pragma location
and@
the same way.
[EW22512]
V3.10 - 2011-03-11
New features-
C99 compliance
Compliance with the ISO C99 standard. Information about the effect of this change is available in the IAR Embedded Workbench for CR16C Migration Guide.
-
Cross calls generated an internal error for some code sequences. This is now corrected.
[EW21248] -
Cross calls in an interrupt function generated an internal error. This is now corrected.
[EW21920], [EW21991] -
The DBS, CAR0, and CAR1 registers can now be used with the intrinsic functions __set_processor_register and __get_processor_register.
[EW19228]
V2.20 - 2009-04-02
New features-
MISRA C:2004 support
IAR Embedded Workbench now supports automatic checking of source code for conformance to the MISRA-C:2004 standard. -
Multi-file compilation
It is now possible to use the IDE to define compilation units with multiple files that will be compiled as one unit, giving the compiler a larger scope for code optimizations. -
New memory type
A new memory type with a corresponding new memory access method has been added. This makes it possible to access a 4 GBytes memory area directly.
-
A template class name for a local label that was missing, generating a linker error[27], has been added
[EW18489] -
The compiler no longer generates an internal error when an undefined segment name is used.
[EW19207] -
uint_fast8_t and uint_fast16_t were mapped to unsigned long. This has been corrected.
[EW20379]
V2.12A - 2007-08-21
- None.
V2.11C - 2007-05-16
Program corrections-
A problem with lost values in registers before function calls has been corrected.
[EW19091]
V2.11A - 2006-04-27
New featuresSupport for macros with variable number of parameters. For example:
#define MY_PRINTF(...) printf(__VA_ARGS__)
In addition to #pragma directives, the _Pragma operator can be used, which in contrast to #pragma directives also can be used in preprocessor macros.
#define LOC _Pragma("location=\"MY_CODE\"")
LOC void test1();
LOC void test2();
-
Using multiple vectors in #pragma vector was syntactically accepted but not reflected in the generated code. For example, the syntax:
#pragma vector=1,2
now generates two vectors for the same function.
[EW15867] -
If
1) the address of an auto struct (x) was passed as an 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,
the new value of x.m would be used in the expression but in some cases not written to x before the call. This is now corrected.
[EW16614] 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.
This is now corrected.
[EW17704]
V2.10F - 2005-05-23
Program correctionsMonitor functions used parameter register R6 to get the status register onto the stack, thereby destroying an unsaved register parameter that is passed in that register. This have been changed so the non-parameter register R7 is used instead.
[EW16334]
V2.10D - 2004-12-10
Program correctionsThe compiler generated twice the address for the function pointer. A shift to compensate for JAL was missing.
[EW16055]The compiler generated a negative index value for indexed addressing mode. To correct this, the compiler is now adapted to the behavior of the CR16CPlus derivatives which triggered this error.
[EW16177]
V2.10A - 2004-05-06
Program correctionsWhen optimizing for high speed, the optimizer could for certain uncommon kinds of loops make an incorrect check of the array value in the loop body.
[EW12326]A right shift with a constant shift value or division where the divisor is a constant that only leaves the high bit, and that is made in an unsigned integer type but casted to a signed integer type could be evaluated in signed instead of the correct unsigned integer type. Example:
signed char x = (unsigned char) y >> 7;
This has now been corrected.
[EW12727]UBROF range errors no longer include fragments of source code in the output file.
[EW13858]Optimization no longer treats ~(x - y) as -(x - y).
[EW14678]The code generated for volatile bitfields with a size greater than 1 was inefficient. This has now been corrected.
[EW14826]
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, that is a class type has an associated memory attribute. This
enables the placement of a class in any suitable memory type.
- 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.
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.
V1.20E - 2004-03-10 (inofficial release)
Program corrections-
Incorrect code could be generated for the if statement. In the
following example:
if ( ((wMem+1) & 0x01)
The compiler would make the AND operation with 0x01 before the addition with 1 which led to incorrect code.
[EW14893]
V1.20D - 2003-12-01 (inofficial release)
Program corrections-
A test inside a loop with contant start and stop values could
be transformed to an unconditional jump if it tested the least significant bit
of the loop counter. This has been corrected.
[EW14634]
V1.20C - 2003-10-29 (inofficial release)
Program corrections-
Calling an address using a function pointer failed due
to the fact, that the JAL instruction shifts the address one bit left. The
compiler did not take care of this, so actual program called the doubled
address.
[EW14568, EW14394]
V1.20B - 2003-08-04 (inofficial release)
Program corrections-
A switch routine could earlier incorrectly destroy the content
of registers that was needed. This has now been corrected.
[EW14249]
V1.20A - 2003-05-06
Program correctionsIn some cases a bitfield assignment, where the right hand side contained a function call that modified other bitfields in the same storage unit, could write back the unmodifed values to the other bitfields. This has been corrected.
[EW13808]Assignments where an array element was assigned another element from the same array could in some cases be optimizied incorrectly. This has been corrected.
[EW12878]The intrinsic function __wait_for_interrupt() incorrectly generated an internal error.
[EW13091]In some cases, a mixed type expression could be incorrectly rewritten if it contained an OR operator with a constant, and the lower part of the constant was zero.
[EW13309]The file iosc14428.sfr contained an incorrect definition of DIP_SLOT_NUMBER_REG.
[EW13363]The compiler incorrectly used to mark all the functions as sorted and therefore disabled the chance for XLINK to split segments at linktime.
[EW13704]Sometimes the optimizer could treat accesses to different struct members, if they were accessed using complex address expressions, as though they would access the same location and thus incorrectly perform optimizations like dead code elimination.
[EW13905]
V1.13A - 2002-10-04
Program correctionsLarge constant tables previously required a large amount of memory during compilation and took a long time to compile.
[EW11830]A problem that could cause the compiler to crash when casting a function pointer to a data pointer has been corrected.
[EW11831]The compiler previously produced incorrect debug information if a header file was completely empty.
[EW11854]The compiler now ensures that bit operations performed on non byte-sized data will be performed using the word variant of the bit instructions. This is needed since some peripheral units do not work properly when accessed using byte-sized instructions.
[EW11911]A problem causing the internal error Different paths give different backtrace info has been corrected.
[EW12027]A problem with inlining of functions that could cause the compiler to crash has been corrected.
[EW12028]A problem leading to the internal error Unexpected exception has been corrected.
[EW12029]An internal error was generated in some very rare cases of switch statements.
[EW12288]Structs of type __data16 could previously not be copied to or from structs of other data types.
[EW12342]Instructions setting the status flags, for example compare instructions, could previously incorrectly be optimized away. This occured in situations where an unconditional branch instruction was executed before the instruction using the condition code was reached.
[EW12396]When accessing external variables using the abs20 addressing mode (__data20 data), the limits were specified incorrectly. Now a link time warning is issued if variables are placed outside the 0x0-0xEFFFF memory range.
Additionally, when using the abs20 addressing modes and constant addresses, the :M modifier behaved incorrectly.
[EW12524]The crosscall optimizer rarely selected two or more sequences that overlapped, but when it did, this resulted in an internal error or incorrect code to be generated.
[EW12688]
V1.12A - 2002-02-28
New features- Floating-point comparisons involving NaN:s (Not a Number) now comply to the IEEE 754-1985 standard. The standard specifies that comparisons using any comparison operator (other than "!=") should yield false if one of the operands is a NaN.
V1.11B - 2002-01-07
Program corrections-
Incorrect code was generated when a global or static array was indexed with an expression (typically a variable) of the unsigned char or unsigned int type.
[EW11040]
V1.11A - 2001-11-30
- First official release