Release notes for the IAR C/C++ Compiler for NEC 78K V4.62.3
(update)
The IAR C/C++ Compiler for NEC 78K can be run as part of the
IAR Embedded Workbench IDE or as a stand-alone command line tool.
The following compilers are available:
- ICC78K - Provides the 78K0 and 78K0S compiler
support
- ICC78K0R - Provides the 78K0R compiler support
Contents
Important information
A new version of the DLIB runtime library is used in
version 4.61A and onwards. This means that object modules
produced with earlier versions of the compiler cannot be
linked together with modules produced with the new
version.
New features (4.62.1)
Code segment name option introduced
A new compiler option, --code_segment,
has been added to make it possible to override the
default code segment name.
Known problems
- The CLIB version of sscanf
is not as accurate as the DLIB version when handling char-to-float operations with values
close to the maximum value that a 32-bit float can handle.
[EW19268]
- The compiler discards any variable info for variables not
referenced before the inline assembler is invoked,
meaning that the inline assembler does not have symbolic
information of a variable or function defined in C, if
they are not used in a C-statement.
Workaround:
1. Use #pragma required
#pragma required = var
2. Use a dummy function that accesses the variables. It
will be removed by the linker if it is never called. [EW16519]
- Using inline assembler with a function or variable that
is not referenced from C earlier, causes the error
message: Error[Og005]:
Unknown symbol in inline assembly.
Workaround:
1. Use #pragma required
= var
2. Use a dummy function that accesses the variables. It
will be removed by the linker if it is never called. [EW10146]
- The 78K preprocessor sometimes recognizes other symbols
than pre-processor symbols, which is wrong. [EW20043]
- The compiler sometimes fails to recognize cases where the
warning Pa084 "Pointless integer comparison"
should be emitted. [EW21048]
Program corrections
- Packed structs could cause misaligned access error. This
has been corrected. [EW21422]
Miscellaneous
Release history
2009-07-01 V4.62.1
- The compiler now generates a remark when a hexadecimal or
octal constant is implicitly cast in a way that it
changes the sign of the constant. [EW21004]
- Some code parts could be scheduled past a DI
instruction for 78K0R. This has been corrected. [EW21002]
- Initializing a global __far pointer with the
address of a __near object in the ROM0/ROM1
area no longer causes the far pointer to point into the ROM0/ROM1
area instead of the ROM-window in the __near
area. [EW20770]
- Functions containing a so called diamond construction
that uses different amounts of stack and is immediately
followed by a while(1); construction no longer
generates an internal error. [EW20744]
- Comparing an external union element with an immediate
value does no longer cause an error when the medium or
lower optimization level is used and the union is located
in __saddr memory. [EW20740]
- Structs that contained only char elements could
be accessed using a MOVW instruction, causing an
alignment error. [EW20722]
- 78K0R now initializes the stack to avoid accessing
uninitialized RAM. This could occur when a returning
function cleaned the stack of pushed parameters. [EW20669]
- Misaligned word-accesses could occur in 78K0R even if --disable_data_alignment
was on. This typically occured for assignment operations
on short variables. [EW21050]
2008-12-15 V4.61A
- The floating-point routines used for 78K0R and DLIB were
not interrupt-safe if an interrupt routine updated a
variable located in the short address area 0xFFE20-0xFFE27.
This has been corrected. [EW20661]
- Long compares with an immediate could generate faulty
code for 78K0/78K0S. [EW20553], [EW20432]
- For 78K0/78K0S, banked function calls could fail on high
optimization levels if several calls were made within the
same function and the passing of parameters and return
values in registers differed between the calls. [EW20475]
- The MISRA-C:2004 rule 10.6 ("use the 'U' suffix")
could sometimes trigger for enum constants. [EW20443]
- The MISRA-C:2004 rule 17.4 would incorrectly trigger for
arrays embedded in structures. [EW20395]
- Using float and long operations in 78K0R could fail with
a read from un-initialized RAM. This has been corrected.
[EW20302]
- The compiler could erroneously emit warning Pa084, "Pointless
integer comparison", in cases involving the greater
than or equal (>=) operator. [EW20559]
2008-07-02 V4.60A
- Using the compiler option -s9 in combination with --workseg_area can no
longer cause the compiler to hang. [EW19810]
- Using ~ on a char bitfield that was
cast to an int
no longer causes an internal error for 78K0/78K0S. [EW19662]
- The compiler no longer generates an incorrect assembler
instruction for 78K0/78K0S, that cannot distinguish
between two symbol names that are identical apart from
upper-/lower-case. [EW19636]
- The compiler no longer reports an incorrect size on DBNZ for 78K0/78K0S
causing an internal error if scr was a saddr type. [EW19632]
- An optimization peephole rule that generated an internal
error for certain code constructions has been corrected.
[EW19547], [EW19186]
- Casts between function and data pointers of the same size
no longer causes an internal error for 78K0R. [EW19515]
- Mixing unsigned
and signed
bitfields in the same struct no longer causes a crash for
78K0R. [EW19514]
- Assigning a float
variable to a signed
int bitfield no longer causes the compiler to fail
with an internal error for 78K0R. [EW19513]
- Long arithmetic and logical operations no longer corrupt
the stack for 78K0R. [EW19512]
- Speed optimizing C switches could result in an internal
error for 78K0R. [EW19511]
- For 78K0R, C switches with test cases that take care of
every possible option no longer generate incorrect code
if all cases use the same code. [EW19510]
- A problem with the 78K0R compiler that sometimes
generated an internal error for pointer arithmetics has
been corrected. [EW19509]
- Deeply nested loops could cause incorrect code to be
generated for 78K0R. [EW19343]
- Tests where an expression containing a left shift is
compared to a constant are now optimized correctly for 78K0R.
[EW19307]
- If the auto area of a function is an even multiple of 256,
the 78K0R compiler now works correctly. [EW19279]
- Accessing multi-dimensional arrays now generates correct
code for 78K0R. [EW19278]
- A loop that contains multiple integer expressions on the
form constant_scale_factor
* i + constant_offset and sizeof(constant_offset) and
differed between the expressions, is now optimized
correctly. [EW19271]
- For 78K0R, casts from float
to long no
longer differ if the 'from' value is a constant or a
variable. [EW19267]
- The strrchr()
function now returns the correct result when the second
parameter is '\0'.
[EW19266]
- C case
statements that should not be executed, were sometimes
executed for 78K0R. [EW19265]
- In some rare cases the optimizer failed to take into
account that a function call could change the contents of
a memory cell that a pointer variable (p) pointed to and assumed that *p had the same value
as before the call. [EW19262]
- The 78K0R compiler could rewrite code to bit operations
that used bit offsets outside the size of the integral
type. This has been corrected. [EW19261]
- Negating a long
variable no longer generates a 'coloring failed' error. [EW19212]
- Partial assignments to a variable where the address of
the variable was cast to another pointer type should no
longer cause an internal error. [EW18959]
- Using a for loop
with a locally declared static variable could crash the
compiler. [EW18872]
- The warning Pe177
could be issued even if the keyword __root was used, which implied
that a variable might not be used in the module. [EW18508]
- The MISRA C diagnostics that should be issued when
compiling with IAR extensions turned on, will now be
issued. [EW18086]
- The following Internal error should no longer appear when
using the command line option --mfc:
Internal error: [CoreUtil/General]:
OgModuleLabels -- label already defined
[EW18571] , [EW18048]
- Instantiating a template class like vector on a function type no
longer results in an internal error after several error
messages. [EW19668]
- The following code generated an internal error: [EW19964]
#define interrupt __interrupt
#define __interrupt interrupt
__interrupt void foo(void){}
- The 78K0/78K0S compiler could hoist a MOV A,PSW past a DI instruction. [EW20059]
- Function pointers as numeric constants no longer cause an
internal error for 78K0R. [EW20067]
- The compiler could in some cases emit incorrect debug
information for typedef
types. When linking with XLINK, this could result in
spurious type conflict warnings. [EW19822]
2007-10-09 V4.50C
- Using the __non_banked
keyword together with the pragma directive forward_attribute caused an
internal error. [EW19215]
- A memory aliasing problem could occur in far data model
on high optimization levels. [EW19259]
- Accessing the last member of a struct with 128 short
member via a pointer could result in a corrupt pointer. [EW19260]
- Assigning a value to a bit in a bitfield, part of an
array of structs, could go wrong. [EW19272]
- Taking the address of an object in an array and passing
it as the first parameter to a function could sometimes
generate faulty code. [EW19263], [EW19264]
- Code that resulted in a MOV
A, [HL+B/C] instruction could destroy the B/C register before
accessing the memory. [EW19312]
- The SEL RB
instruction could be optimized away on higher
optimization levels if the interrupt function was big
enough to use all 4 register pairs. [EW19342]
- Character division could generate faulty code under some
circumstances. [EW19546]
- In some rare cases, a series of assignments could be
incorrectly optimized away. Example: [EW19495]
x = ...;
y = x;
x = !z;
...
use(y);
2007-07-06 V4.50B
- Casts from __near to __far_func caused
an illegal state internal error, and casts between __far
and __far_func caused an internal error "casts
to same size". [EW19206]
- Using #pragma pack with 78K0R on __far
objects in the near data model could generate faulty
access code. [EW19177]
- Placing variables in a reserved segment could cause an
internal error. [EW19166]
- Pointer/array expressions that resulted in a bit test
instruction caused an internal error for 78K0S. [EW19137]
- An unhandled exception could occur on medium and high
optimization levels. [EW19083]
2007-05-11 V4.50A
- Post increment/decrement on absolute variables caused an
internal error for the 78K0R compiler. [EW18462]
- For certain code, the linker generated a range error
message for near constants if the compiler option -z3 was used with the
78K0R compiler. [EW18557]
- Adding a variable to an array placed in SFR memory could
result in wrong code for 78K0. [EW18807]
- For low optimization levels, comparing two 1-bit
bitfields could generate faulty code. [EW18863]
- The CS and ES registers were not
saved in interrupt routines for 78K0R. [EW18873]
2006-10-05 V4.40B
- Using #pragma location
to set segments to static banked functions could cause
the compiler to generate wrong code. [EW18290]
- Range checks caused a linker error for constants located
in the mirror 0
and mirror 1
area. [EW18390]
- Bit tests against the short
address area could generate faulty code for 78K0R. [EW18450]
- A 16-bit access to an SFR
outside the short
address area could generate an illegal instruction. [EW18455]
- Tests directly against the return value of a function
could be optimized away in rare circumstances. [EW18241]
- Complex logical operations resulted in an illegal state
if the right operand was a complex expression resulting
in a carry
operand. [EW18249]
- Bit tests in an if
statement could cause an internal error. [EW18306]
- The label for interrupt vectors were of the wrong kind
and could generate link errors if MISRA C was enabled. [EW18449]
2006-07-07 V4.40A
- Including an I/O definition header and referencing more
than one SFR from C++ code will no longer result in
incorrect warnings when linking. [EW17929]
- The library function vswitch
for integers only supported up to 127 cases. [EW17863]
- Interrupt functions that had an auto area size that was
odd could potentially destroy registers in other register
banks at exit. [EW17787]
- A construction of type:
char var;
if ( var-- )
{ ... }
where var was
located in workseg,
could generate faulty code. [EW17706]
- 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 an immediate. [EW17705]
- Some violations of MISRA C rule 83 (implicit conversion
of return value) were only detected if rule 77 (implicit
conversion of function parameter) was also turned on. [EW17277]
- A reference to a static symbol with file scope from an
inline assembler statement no longer generates an error.
[EW17193]
2005-09-05 V4.30C (patch release)
- Between version 4.20A and 4.30A a bug related to
interrupt vectors were fixed. This caused an
incompatibility between object files created with
different versions of the compiler. Now, a linker error
is generated if you try to link an object file produced
with an earlier compiler version with a file produced
with version 4.30C. This also means that libraries have
to be rebuilt to be compatible with the new version of
the compiler. [EW17188]
- The option --disable_data_alignment
could cause illegal byte accesses to word SFR's. [EW17169]
- Using the __banked
keyword or the banked code model, it was possible to
place interrupt functions in banked memory. [EW17082]
- Using tiny calls could cause the compiler to make false
assumptions about memory contents which lead to too
aggressive optimization. [EW17014]
- Alignment of linked variables could cause unnecessary
holes in memory. [EW17069]
- The compiler generated a non-banked call if a non-banked
function called a static banked function. [EW17240]
2005-07-15 V4.30A
- The compiler generated wrong code for assignment of a
bitfield element using logical operators. Example:
Bits1.bit0 = ~FBits0.bit7; [EW17029]
- Assigning a 1-bit bitfield to another 1-bit bitfield,
where the destination address must be calculated at
runtime, could generate faulty code. [EW16862]
- The compiler could erroneously hoist (move) code past a
register bank select instruction. [EW16846]
- Writing to a 1-bit bitfield could fail if the compiler
had to use the [HL]
address mode. [EW16813]
- For high optimization levels, the compiler sometimes used
wrong access order for a sequence of multiple accesses to
the same bitfield. [EW16739]
- Comparisons on a volatile char could be optimized away if
the variable was set immediately before the comparison. [EW16683]
- Constructions like a[i]
= i; where i
was a register variable could cause the compiler to
generate in-correct code. [EW16554]
- The call chain information got corrupted if both non-banked
and banked functions were mixed. [EW16403]
- A re-definition of a symbol using __no_init, now generates an
error. [EW16202]
- The compiler now emitts a warning if a reserved segment
name is used as location for variables and functions. [EW16143]
- Using the --diagnostic_tables
option caused an internal error. [EW16130]
- The compiler now generates re-locatable instead of
absolute entries for interrupt vectors. [EW16067]
Note: If user has overridden the CSTARTUP.S26 then the
INTVEC segment definition must be changed from absolute
to relative.
- The optimizer emitted the following internal error for a
specific piece of code:
[CoreUtil/General]:
Const_Folding - Internal error. [EW16876]
- Blocks that ended in bit stores and were merged by the
optimizer could generate wrong code if the bits where
located in the same byte. [EW16870]
2004-10-26 V4.20A
- Located structs declared const caused an internal error.
[EW15885]
- It is now possible to change or delete the default
compiler include path. [EW15717]
- Certain code constructs could generate an internal error
if high speed optimization was selected. [EW15607]
- A volatile declared load of a short variable on an
absolute address could be optimized away. [EW15585], [EW15587]
- The __callf
keyword was in-correctly enabled for the 78K0S core
option. [EW15549]
2004-05-14 V4.11A
Copyright (C) 2009 IAR Systems AB.