- Important information
- New features
- Known problems
- Program corrections
- User guide corrections
- Miscellaneous
- Release history
Important information
- Compiler MISRA C C:1998/C:2004 support deprecation notice
The MISRA C compiler support is deprecated starting with EWRL78 version 4.21 and will be removed in a future release. Refer to IAR C-STAT for full MISRA C support. Binary compatibility
Object modules produced with earlier versions of the compiler cannot be linked together with modules produced with version 2.20 and onwards due to Renesas ABI (Application Binary Interface) compatibility changes.Calling convention
ELF/DWARF as object format and a new calling convention was introduced in v2.10 to support the Renesas ABI. For backwards compatibility with existing assembler source code, the calling conventions used by version 1.x is also supported. See the Development Guide for detailed information.
Read the guide Migrating from UBROF to ELF/DWARF if you are migrating from version 1.x of this product.
New features
- None
Known problems
-
[EWRL78-753] Using __sfb() to read the start or end of a section can result in the wrong address being returned if the section is located inside the ROM mirror area. Objects inside this area will get an additional F in the third byte of the address, like 0xFxxxx, and will be accessed as if they were located in the RAM mirror area.
-
[EWRL78-601] A multiplication of a real floating point type (r1) with a complex type will promote r1 to a complex type before the multiplication. This produces undesirable results when infinite number, NaNs, or -0.0's are involved. The same thing happens when you divide a complex type with a real floating type.
-
[EWRL78-364, EW24353] Very deep nestlings of struct declarations, parenthesis or if-else statements, may generate a stack overflow error in the compiler.
Program corrections
-
[EWRL78-883] If you copy several bits (1-bit bitfields) in sequence to the same destination byte, this can in some cases lead to faulty code being generated for optimization level Medium or higher.
User guide corrections
-
[EWRL78-813] The order of the registers in Table 16: Registers used for passing parameters, on page 169 of the IAR C/C++ Development Guide for RL78 (revision DRL78_I-5) is not the order in which the registers are used for parameter passing. The order of 8-bit values passed in registers is: A,X,C,B,E,D
Miscellaneous
- NOP instruction after DIVWU and DIVHU
From version 1.40.3 and onwards, the compiler adds a NOP instruction for the RL78 S3 MCU core after every DIVWU and DIVHU instruction. This is a workaround for a conflict in the actual MCU between divide instructions and multiple interrupts. For more information, see Renesas Electronics Operating Precautions document number R01TU0067ED0200.
Release history
4.21.2 2021-08-12
New features
- The generated code for shift operations on volatile declared variables has been optimized.
4.21.1 2021-04-29
Program corrections
-
[EWRL78-831]
A program built with the Far code model, or using __far_func functions, can generate faulty code for switches if the code for the switch and its associated cases span across a 64k border. This only happens for one specific switch pattern. To check if the code might have this bug, check the compiler list files and the linker map file for labels containing the string VSWITCH.
-
[EWRL78-827]
The byte order of the offset in the opcode for MOVW offset[BC/B/C],AX is swapped. This only affects the assembler code and the C inline assembler, as the C/C++ compiler does not generate this instruction.
Other instructions that use this address mode work correctly
-
[EWRL78-810]
For S3 cores, the cross-jumping optimization can cause an internal error when the compiler checks that all DIVHU/DIVWU instructions are followed by a {{NOP }}instruction.
-
[EWRL78-687]
A function that uses switches can fail if the switch is large enough to use a table, and the switch cases are placed by the linker so that some of them end up on different 64 Kbyte pages.
4.20.2 2020-02-20
Program corrections
-
[EWRL78-779]
Subtraction of char values can fail if there are two or more subtractions following each other where the minuends have the same value.
-
[EWRL78-774]
Calculating a memory area size by casting two far pointers to a long integer, and saving the difference, will result in a subtraction of the index part of the pointers, i.e. the lower 16 bits, instead of the expected 32-bit subtraction.
-
[EWRL78-773]
The compiler can generate incorrect code for comparisons of floating-point numbers, on all optimization levels. If at least one of the numbers is NaN, the result of the comparison is sometimes reversed.
-
[EWRL78-788]
When using the function inlining optimization and the far data model, accessing the first struct member via a pointer to the same struct might cause an internal error.
4.20.1 2019-12-04
Program corrections
-
[EWRL78-645, TPB-3070]
On optimization level High, a float, long long int, or double array element value with auto storage duration gets the wrong live range and shares stack area with other live objects on 8- and 16-bit compilers that internally rewrite operations as function calls, if the last use is such an operation and the surrounding loop is subject to the optimization Induction variable elimination. An example, where i and a share stack area even though their live ranges overlap:
int flg = 0 ;
void func( void )
{
int i ;
long long int a[2] = { 0, 1 } ;
for ( i = 0; i < 2; i++ ) {
if ( a[i] != i ) flg++ ;
}
}
-
[EWRL78-770]
Due to a memory dependency problem, the compiler might generate slightly different code depending on which software license locking criteria is used. The code correctness is not affected.
-
[EWRL78-769]
Casting a subnormal 32-bit float value to a (64-bit) double produces the wrong result for values in the range 0x00080000-0x007FFFFF (~1.E-40 to ~1.2E-38), regardless of the sign, and will enter an endless loop if the lower 19 bits of the mantissa are zero (while in this range).
-
[EWRL78-747]
The instruction MOV ES, S:label generates an illegal syntax error.
New features
C18 support
The default Standard C is now C18 (ISO/IEC 9899:2018).
C++17 support
The compiler now supports almost all C++17 features. The
C++ library supports C++14 with no C++17 additions.
4.10.1 2018-12-18
Program corrections
-
[EWRL78-719]
The compiler emits "Error[Pe007]: unrecognized token" for UTF-8 (BOM) encoded source files.
-
[EWRL78-705]
Using the same vector number more than once for an interrupt function causes an internal error.
See also EWRL78-675
-
[EWRL78-699]
Depending on the register allocation, the compiler can generate incorrect code for 8-bit logical and arithmetic operations where one of the operands is an indirection of a pointer.
-
[EWRL78-698]
If no memory attribute is specified explicitly for #pragma constseg, the section will be placed in near memory regardless of which data model that is in use.
-
[EWRL78-687]
A function that uses switches can fail if the switch is large enough to use a table, and the switch cases are placed by the linker so that some of them end up on different 64 Kbyte pages.
-
[EWRL78-675]
Having two or more identical interrupt functions in the same file can cause an internal error.
See also EWRL78-705
-
[EWRL78-657, TPB-2779, EW26673]
The documentation fails to mention that system() returns 0 for a NULL parameter.
-
[EWRL78-655]
The compiler erroneously assumes that the pointer parameter, associated with a %n specifier in the format string to a printf-like standard library function, is not used for writing back information. If the variable that the pointer is pointing to isn't used further or can be optimized away by other optimizations, the write-back will corrupt the stack. This happens on Medium optimization level and higher.
-
[EWRL78-653]
The result of floating point operations with FLT_MIN can differ minutely between a compile time calculated expression and a run time calculated expression with the same values.
-
[EWRL78-650]
The code transformation Common Subexpression Elimination can sometimes cause internal errors when used on code that contains volatile long long arrays.
-
[EWRL78-647], [EWRL78-648]
Sign-extending long long bitfields can cause an internal error.
-
[EWRL78-646]
The compiler sometimes fails to calculate correct live ranges for local long long arrays, causing them to share stack space with other local variables.
See also EWRL78-638
-
[EWRL78-641]
Taking the address of a local long long array/struct and using it to initialize a local long long pointer can cause the two variables to share the same stack address.
-
[EWRL78-638]
The compiler sometimes fails to calculate correct live ranges for local long long arrays, causing them to share stack space with other local variables.
See also EWRL78-646
-
[EWRL78-607]
The square root function in the floating-point library returns +0.0 for sqrt(-0.0) and not -0.0 like the standard specifies.
-
[EWRL78-606]
The library function putchar(-1) incorrectly interprets -1 as EOF when the standard says that it should be interpreted as the character 0xFF.
-
[EWRL78-604]
errno() might cause a range error if the first argument to a function is DBL_MIN and the sign of the second argument is opposite to the first argument.
See also EWRL78-603
-
[EWRL78-603]
errno() might cause a range error if the first argument to a function is DBL_MIN and the sign of the second argument is opposite to the first argument.
See also EWRL78-604
-
[EWRL78-602]
The C library functions iswctype() and wctype() are not handling "blank" correctly.
-
[EWRL78-587]
If the code contains a simple character literal followed by a wide character literal, an error is issued. Example: wchar_t buf[] = L"1""2";
-
[EWRL78-585]
On optimization level -Om or higher the compiler can generate erroneous code for functions with a recursive call followed directly by a switch statement where one of the cases has the only effect that the function exits.
-
[EWRL78-584]
The C library function isblank(c) will in some cases erroneously return true for a few characters (\f, \n, \r and \v).
New features
Support for the C11 language standard
The compiler and libraries add support for the latest C language standard ISO/IEC 9899:2011.
Note: the new C library binary object interface is incompatible with earlier versions of the product.
Support for the C++14 language standard
The compiler and libraries now support the latest C++ standard ISO/IEC 14882:2014.
Note: the new C++ library binary object interface is incompatible with earlier versions of the product.
Unicode support
The Unicode standard for consistent encoding, representation, and handling of text is now supported.
This means that you can use Unicode characters (alphabetic, numeric, symbols, emoji, etc)
in the source code.
Stack protection
The IAR C/C++ compiler for RL78 now supports stack protection. A canary value will be placed
between the stack variables and the return address so that the system can detect corruption
of a function return address before the function returns to that address. The compiler will
use heuristic to determine whether a function needs stack protection or not. If any defined
local variable has the array type or a structure type that contains a member of array type,
the function will need stack protection. See the IAR
C/C++ Development Guide for more information.
3.10.1 2017-09-15
Program corrections
-
[EWRL78-659] The compiler might generate an internal error if the --mfc option is used and more that one interrupt declaration is using the same interrupt vector.
-
[EWRL78-649] The compiler can sometimes combine an INCW and an ADDW instruction even if a following instruction depends on correct flags from the ADDW instruction.
-
[EWRL78-644] The compiler sometimes removes 16-bit compares in if statements if the value of the variable - instead of being re-read - is restored by adding a constant before the compare.
See also EWRL78-649
-
[EWRL78-642] Switch statements on type long long are not supported by the compiler.
-
[EWRL78-639] Returning a long long value and storing it in a struct can cause a common subexpression elimination temporary to be used, which in turn can cause an internal error.
-
[EWRL78-635] Reading the value of an object pointed to by a signed short cast to a far pointer can cause an internal error.
-
[EWRL78-634] Two different interrupt functions that uses the same vector can cause an internal error.
See also EWRL78-538
-
[EWRL78-632] Absolute placement of initialized constants in the near data area (0xF0000-0xFFFFF) will generate an error. If you use this area for data flash, you should change this error to a warning.
-
[EWRL78-576] The cross call optimization might move the NOP instruction that follows a DIVWU/DIVHU instruction, which can lead to intermittent errors.
-
[EWRL78-565] The command line option --no_crosscall has been renamed to --no_cross_call to match the documentation and conform to other IAR products.
-
[EWRL78-564] Casting from a far function pointer to a huge data pointer causes an internal error.
-
[EWRL78-547] On optimization level High, function-local static variables that are assigned only the constants 0 and 1 but initialized with another value, can be optimized incorrectly.
-
[EWRL78-538] Two interrupt functions that use the same vector might cause an internal error without a previous warning.
See also EWRL78-634
-
[EWRL78-519] MISRA-C:2004 rule 12.4 does not work for && expressions where a volatile variable is the second expression.
-
[EWRL78-507] Casting a near pointer to a short, and then casting it to a far pointer, and then to a long, might cause an internal error.
See also EWRL78-506
-
[EWRL78-506] Casting a near pointer to a short, and then casting it to a far pointer, and then to a long, might cause an internal error.
See also EWRL78-507
New features
- The __packed type attribute is now supported to specify a data alignment of 1 for a data type.
2.21.1 2016-05-31
Program corrections
-
[EWRL78-637] A sequence of common subexpressions, containing pointer indirections, can be optimized incorrectly if the sequence occurs in parallel flows of control. The problem is triggered when the optimization "loop unrolling" has been disabled, for loops only, either:
1) with indirect pointer access. Example: *(p + index] or
2) for array constructs. Example: p[index]
that appear more than once and that are candidates for common subexpression elimination. A workaround is to use the optimization "loop unrolling", i.e. do not set the option --no_unroll.
-
[EWRL78-597] Sign-extending a signed int or short register variable to a long, might destroy the register variable if it is located in register AX.
-
[EW25997] An internal error will be generated for the following statement:
asm("MOVW SP, #LWRD(sfe(""CSTACK""))");
-
[EW26007] Floating point comparison fails if the difference between the operands is one bit only. Example: -16777215.0F <= -16777216.0F. A workaround is to compare with a (const) volatile variable or an external const declared variable instead of a constant.
-
[EW25999] Casting an SFR address to far memory and accessing a 1-bit bitfield will in some case generate an illegal state error.
2.20.1 2015-12-17
Program corrections
-
[EW25715] Huge-declared objects that are initialized and larger than 64 KByte generate an error.
-
[EW25690], [EW25691], [EW25692] A number of small changes have been implemented to better comply with the Renesas ABI (Application Binary Interface).
New features
-
Stack usage analysis
With stack usage analysis enabled, a stack usage section will be added to the linker map file
with listings of the maximum stack depth for each call graph root.
The analysis process can be customized to take into account such constructs as calls via function pointers and recursion.
The output can optionally be generated in XML format for post-processing activities.
2.10.4 2015-11-05
Program corrections
-
[EW25763] Some instructions that have one operand of type imm[BC] might generate incorrect offsets to BC if the offset is a constant (not a label).
-
[EW25713] Far pointers that have a constant value (known at compile time) and that point into the short-address area can in some cases generate an internal error.
2.10.3 2015-08-31
Program corrections
-
[EW25541] The following statement generates an internal error: (void)(unsigned short int )( (*(unsigned short *)0xF06E6) );. The workaround is either to remove the (void) cast or make the pointer cast volatile.
-
[EW25593] Interrupt routines using the new Renesas calling convention (v2) fail to save the scratch registers.
-
[EW25644] The CPU information in the ELF object file format header field e_flags is not set up correctly.
2.10.2 2015-07-10
Program corrections
-
[EW25533] Reading a 16-bit SFR that is located in the memory range 0xFFF00-0xFFF1F might generate an internal error.
-
[EW25516] Accessing signed long bitfields of size 16 bits might generate illegal code.
Example:
long b;
struct { long a : 16; } st;
b = st.a;
2.10.1 2015-06-15
Program corrections
-
[EWRL78-654, EWRL78-656] The optimizer considers all labels of long long constants (i.e. internally generated long long constants) to be equal which can cause cross call and cross jump to fail.
-
[EWRL78-643] Recursive functions with a parameter consisting of a recursive struct can cause an internal error.
-
[EW24996] Tail recursive calls before a switch statement will in some cases generate an internal error.
-
[EW25000] Bitfield variables can in some rare cases be optimized incorrectly on optimization level high, if there are multiple assignments to two or more bitfield members and at least one of them is assigned a constant.
-
[EW24994] When a bitfield member is assigned a constant value followed by an assignment to another bitfield member in the same variable, an internal error is in rare cases generated on optimization level high.
-
[EW25002] Cases where multiple bitfields are assigned in one statement, for example a.bitfld1 = b.bitfld2 = c.bitfld3 = 1;, might be optimized incorrectly on optimization level high.
-
[EW25100] Setting up the hardware multiplier/divider manually from C source code on S2 core devices (--core=rl78_1) might cause incorrect code to be generated.
-
[EW24733] The compiler does not check the MISRA-C:2004 rule 10.6 correctly. It bases the check on the use of the constant instead of its type.
-
[EW24883] MISRA-C:2004 rule 10.1 is falsely triggered for an implicit cast from a _Bool data type to an integer or floating point data type.
-
[EW24359] Exceeding the allowed limit of parameters passed to a function might generate a compiler error.
-
[EW24361] An internal error [Front end]: assertion failed: clone_macro_text_map_entries map entry pointer past end of entries array is generated for the following source code example:
#define main()
int main
#define mainbody () { return 0; }
mainbody
-
[EW25288] Several support routines for long operations might generate an out of range error at link time when using far runtime library calls.
-
[EW25270] C switch statements with long long variables are not supported.
-
[EW25227] The compiler emits an error when processing an out of class definition of a const or volatile member function of a class with a class memory.
Example:
struct __far S
{
int fun() const;
int mS;
};
int
S::fun() const
{
return mS;
}
-
[EW25225] When using multi-file compilation (--mfc), conflict between fields of a file or namespace scope anonymous union/struct and entities defined in another module is not detected, which can lead to internal errors in later processing.
New features
-
Renesas RL78 ABI compliance
-
Double-precision floating-point format
1.40.6 2014-11-12
Program corrections
-
[EW25080] The compiler adds a NOP instruction for the RL78 S3 MCU core after every DIVWU and DIVHU instruction as a workaround for an error in the MCU. However, the instruction scheduler will in some cases move an instruction in between the DIVWU/DIVHU instruction and the NOP. A workaround is to use the --no_scheduling option.
-
[EW24999] Copying a string literal to a char array using strcpy might cause incorrect inline code to be generated. (This problem was only partly corrected in v1.40.5).
1.40.5 2014-10-24
New features
-
[EW24990] Improved code generation for bit handling.
Program corrections
-
[EW25004] On optimization level high, loops containing an expression where the result of the expression depends on unsigned overflow of a smaller type can in some case be optimized incorrectly.
-
[EW25030] Long division using the DIVWU instruction will in rare cases destroy other register variables contained in the HL or DE registers.
-
[EW24999] Copying a string literal to a char array using strcpy might cause incorrect inline code to be generated.
-
[EW24995] Comparing a near data pointer with (void __near *) -1 will in some cases generate an internal error.
1.40.3 2014-09-17
Program corrections
-
[EW24899] The compiler can erroneously report a non-existing violation of MISRA-C:2004 rule 14.10 (final else after if...else if) in some cases involving nested if statements.
-
[EW24819] Dividing a long long constant with a variable fails. Example: 1234567ULL / var.
-
[EW24683] The pragma #pragma default_variable_attributes is ignored when the keyword const is used on the variable following the pragma.
-
[EW24655] Copying a 1-bit bitfield to a 1-bit bitfield in a struct accessed via a pointer fails.
-
[EW24860] __huge constant data is placed in the NEAR_CONST segment instead of in the HUGE_CONST segment.
-
[EW25006] Instead of assigning a correct return value, the input parameter value is used as return value in the following example:
int b = 1;
int func( int a )
{
return( a = b++ );
}
1.40.2 2014-06-10
New features
-
Japanese translation.
1.40.1 2014-04-10
Program corrections
-
[EW24357] The compiler sometimes generates an internal error just after the error Error[Pe066]: enumeration value is out of "int" range.
-
[EW24511] Nestling boolean expressions can in rare cases cause an illegal state error on lower optimization levels.
-
[EW24362] The compiler sometimes generates an internal error just after the error Error[Pe078]: a parameter declaration may not have an initializer.
-
[EW24363] An error for an enum constant with an illegal value is sometimes followed by an internal error.
-
[EW24366] The compiler sometimes generates the internal error Internal Error: [PaType - MemoryAttribute]: no memory attribute set. after a user code error.
-
[EW24368] The compiler sometimes generates an internal error just after the error Error[Pe168]: a function type is not allowed here, for an erroneous bitfield type.
-
[EW24298] The assembler replacement routines for 16-bit signed division and modulo operations do not preserve the BC register correctly.
-
[EW24573] The rewritten floating-point routines are not fully compatible with the __far run-time library calls option and this causes a linker error.
New features
-
The compiler now supports the C++ feature Multiple
inheritance.
-
The compiler now supports the __huge keyword to
enable access beyond a 64-Kbyte boundary.
-
The C/C++ Compiler User Guide has been updated to reflect the product changes.
1.30.7 2014-01-23
Program corrections
-
[EW24383] An expression (e) containing an auto variable (v) and one or more indirect accesses could be optimized incorrectly if the expression was preceded by a statement where v is assigned the result of a function call, and e contains the only use of v (before v is assigned another value).
1.30.6 2013-12-18
Program corrections
-
[EW24389] The keyword __no_bit_access does not work correctly with an expression like this:
*(volatile ushort __no_bit_access *)(ushort)(0xFFF10U)
1.30.5 2013-10-11
Program corrections
-
[EW24198] Loading a far pointer via another far pointer might generate faulty code.
New features
-
Two new pragmas, #pragma default_function_attributes and #pragma default_variable_attributes, are introduced to set default segment placement and type and object attributes for variables and functions. See section User guide corrections for more information.
1.30.4 2013-09-06
Program corrections
-
[EW24151] On optimization level high, casting a near pointer to a far pointer via a unsigned/signed short might result in a near to far cast instead of a zero-extend cast.
-
[EW24136] Accessing a packed struct member might result in an internal error if the size of the member is two bytes or larger.
-
[EW24074] The memory tracking system does not properly canonicalize the source address when looking up data during optimizations. This can lead to missed optimizations as well as incorrect optimzations.
1.30.3 2013-06-14
Program corrections
-
[EW23939] Bit access on pointers is sometimes performed even though the __no_bit_access keyword is used.
-
[EW23965] On high optimization, a variable (v) can be optimized incorrectly if v is incremented with a constant value inside a do loop, the do loop has a computable trip count, the do loop is surrounded by another loop with a computable trip count, and v is not used inside either of the two loops, except for the increment.
-
[EW23972] An indirect postincrement of the result of a postincrement ( (*p++)++ ), is not handled correctly.
1.30.2 2013-03-15
Program corrections
-
[EW23562] Placing __near const variables in a user defined segment, and using rom location=ram causes the compiler to ignore the user defined segment and copy the const variable to RAM.
-
[EW23421] An inline assembler statement following immediately after a constructor call, destructor call, or an intrinsic library function that returns the first parameter, triggers an internal error.
New features
-
The compiler command line options --aggressive_inlining and --aggressive_unrolling have
been removed and are replaced by the new option --no_size_constraints.
-
A new Call Graph window has been added. It is browsable
and displays all calls made to and from each function
from any source file in the active project.
-
Code generated for floating-point operations is now
faster compared to the previous version.
1.30.1 2013-03-01
-
Pre-release.
1.20.4 2012-10-30
Program corrections
-
[EW23478] The extended keyword __no_bit_access did not work for auto variables.
-
[EW23550] A 16-bit ADD/SUB with an immediate could under rare circumstances destroy the contents of a register variable.
1.20.3 2012-08-09
Program corrections
-
[EW23320] Pointer expressions of the kind *(Base - imm*variable) no longer cause incorrect code to be generated using the imm[BC] address mode.
-
[EW23224] Using memcpy with sizeof(segment) as size parameter no longer causes an internal error.
-
[EW23344] The compiler no longer generates faulty code when casting a near data pointer to a far pointer. This could result in the value 0 instead of 15 on lower optimization levels.
1.20.1 2012-04-13
Program corrections
-
[EW22717] The build process no longer stops prematurely for certain code examples where macros are expanded within macros.
-
[EW23051] Near pointer indexing no longer causes incorrect use of the word[BC] address mode if it is on the form array[-var] or array[0x100-var].
-
[EW22844] Defining the same label name in several different inline assembler statements no longer causes an internal error in the compiler. Labels in inline assembler statements are now automatically renamed to avoid this problem.
-
[EW22723] Using memcpy with a destination in the auto area no longer causes incorrect code on high optimization levels.
-
[EW22669] MISRA-C checker errors without a known file position no longer cause the compiler to crash when the option --header_context is used.
-
[EW22203] The total number of errors and warnings presented by the compiler was doubled compared to the real amount.
-
[EW23118] Common sub-expressions that contain side effects no longer cause incorrect code to be generated.
New features
-
Code generated for integer arithmetics and floating-point operations is now several times faster compared to
the previous version. Code inlining has also been improved in the case of optimizing for speed.
-
A compiler option, --generate_far_runtime_library_calls, has been
added to make it possible to place libraries (the RCODE segment) in far code
memory.
-
An object attribute called __ro_placement has been
added. This is useful, for example, for placing a const volatile variable in flash memory residing in ROM.
1.10.4 2011-08-11
Program corrections
-
[EW22606] The compiler could generate an illegal address mode if an absolute placed variable was indexed with a negative value.
-
[EW22607] Accessing far variables from within an interrupt routine could generate an internal error.
1.10.2 2011-06-23
Program corrections
-
[EW22480] When casting an address of a short address variable to a far pointer, the compiler no longer optimizes the code in a way so that an internal error is generated.
1.10.1 2011-03-01
-
Initial release.
New features
- The generated code for shift operations on volatile declared variables has been optimized.
4.21.1 2021-04-29
Program corrections
-
[EWRL78-831] A program built with the Far code model, or using __far_func functions, can generate faulty code for switches if the code for the switch and its associated cases span across a 64k border. This only happens for one specific switch pattern. To check if the code might have this bug, check the compiler list files and the linker map file for labels containing the string VSWITCH.
-
[EWRL78-827] The byte order of the offset in the opcode for MOVW offset[BC/B/C],AX is swapped. This only affects the assembler code and the C inline assembler, as the C/C++ compiler does not generate this instruction.
Other instructions that use this address mode work correctly
-
[EWRL78-810] For S3 cores, the cross-jumping optimization can cause an internal error when the compiler checks that all DIVHU/DIVWU instructions are followed by a {{NOP }}instruction.
-
[EWRL78-687] A function that uses switches can fail if the switch is large enough to use a table, and the switch cases are placed by the linker so that some of them end up on different 64 Kbyte pages.
4.20.2 2020-02-20
Program corrections
-
[EWRL78-779] Subtraction of char values can fail if there are two or more subtractions following each other where the minuends have the same value.
-
[EWRL78-774] Calculating a memory area size by casting two far pointers to a long integer, and saving the difference, will result in a subtraction of the index part of the pointers, i.e. the lower 16 bits, instead of the expected 32-bit subtraction.
-
[EWRL78-773] The compiler can generate incorrect code for comparisons of floating-point numbers, on all optimization levels. If at least one of the numbers is NaN, the result of the comparison is sometimes reversed.
-
[EWRL78-788] When using the function inlining optimization and the far data model, accessing the first struct member via a pointer to the same struct might cause an internal error.
4.20.1 2019-12-04
Program corrections
-
[EWRL78-645, TPB-3070]
On optimization level High, a float, long long int, or double array element value with auto storage duration gets the wrong live range and shares stack area with other live objects on 8- and 16-bit compilers that internally rewrite operations as function calls, if the last use is such an operation and the surrounding loop is subject to the optimization Induction variable elimination. An example, where i and a share stack area even though their live ranges overlap:
int flg = 0 ; void func( void ) { int i ; long long int a[2] = { 0, 1 } ; for ( i = 0; i < 2; i++ ) { if ( a[i] != i ) flg++ ; } }
-
[EWRL78-770] Due to a memory dependency problem, the compiler might generate slightly different code depending on which software license locking criteria is used. The code correctness is not affected.
-
[EWRL78-769] Casting a subnormal 32-bit float value to a (64-bit) double produces the wrong result for values in the range 0x00080000-0x007FFFFF (~1.E-40 to ~1.2E-38), regardless of the sign, and will enter an endless loop if the lower 19 bits of the mantissa are zero (while in this range).
-
[EWRL78-747] The instruction MOV ES, S:label generates an illegal syntax error.
New features
C18 support
The default Standard C is now C18 (ISO/IEC 9899:2018).C++17 support
The compiler now supports almost all C++17 features. The C++ library supports C++14 with no C++17 additions.
4.10.1 2018-12-18
Program corrections
-
[EWRL78-719] The compiler emits "Error[Pe007]: unrecognized token" for UTF-8 (BOM) encoded source files.
-
[EWRL78-705] Using the same vector number more than once for an interrupt function causes an internal error.
See also EWRL78-675 -
[EWRL78-699] Depending on the register allocation, the compiler can generate incorrect code for 8-bit logical and arithmetic operations where one of the operands is an indirection of a pointer.
-
[EWRL78-698] If no memory attribute is specified explicitly for #pragma constseg, the section will be placed in near memory regardless of which data model that is in use.
-
[EWRL78-687] A function that uses switches can fail if the switch is large enough to use a table, and the switch cases are placed by the linker so that some of them end up on different 64 Kbyte pages.
-
[EWRL78-675] Having two or more identical interrupt functions in the same file can cause an internal error.
See also EWRL78-705 -
[EWRL78-657, TPB-2779, EW26673] The documentation fails to mention that system() returns 0 for a NULL parameter.
-
[EWRL78-655] The compiler erroneously assumes that the pointer parameter, associated with a %n specifier in the format string to a printf-like standard library function, is not used for writing back information. If the variable that the pointer is pointing to isn't used further or can be optimized away by other optimizations, the write-back will corrupt the stack. This happens on Medium optimization level and higher.
-
[EWRL78-653] The result of floating point operations with FLT_MIN can differ minutely between a compile time calculated expression and a run time calculated expression with the same values.
-
[EWRL78-650] The code transformation Common Subexpression Elimination can sometimes cause internal errors when used on code that contains volatile long long arrays.
-
[EWRL78-647], [EWRL78-648] Sign-extending long long bitfields can cause an internal error.
-
[EWRL78-646] The compiler sometimes fails to calculate correct live ranges for local long long arrays, causing them to share stack space with other local variables.
See also EWRL78-638 -
[EWRL78-641] Taking the address of a local long long array/struct and using it to initialize a local long long pointer can cause the two variables to share the same stack address.
-
[EWRL78-638] The compiler sometimes fails to calculate correct live ranges for local long long arrays, causing them to share stack space with other local variables.
See also EWRL78-646 -
[EWRL78-607] The square root function in the floating-point library returns +0.0 for sqrt(-0.0) and not -0.0 like the standard specifies.
-
[EWRL78-606] The library function putchar(-1) incorrectly interprets -1 as EOF when the standard says that it should be interpreted as the character 0xFF.
-
[EWRL78-604] errno() might cause a range error if the first argument to a function is DBL_MIN and the sign of the second argument is opposite to the first argument.
See also EWRL78-603 -
[EWRL78-603] errno() might cause a range error if the first argument to a function is DBL_MIN and the sign of the second argument is opposite to the first argument.
See also EWRL78-604 -
[EWRL78-602] The C library functions iswctype() and wctype() are not handling "blank" correctly.
-
[EWRL78-587] If the code contains a simple character literal followed by a wide character literal, an error is issued. Example: wchar_t buf[] = L"1""2";
-
[EWRL78-585] On optimization level -Om or higher the compiler can generate erroneous code for functions with a recursive call followed directly by a switch statement where one of the cases has the only effect that the function exits.
-
[EWRL78-584] The C library function isblank(c) will in some cases erroneously return true for a few characters (\f, \n, \r and \v).
New features
Support for the C11 language standard
The compiler and libraries add support for the latest C language standard ISO/IEC 9899:2011.
Note: the new C library binary object interface is incompatible with earlier versions of the product.Support for the C++14 language standard
The compiler and libraries now support the latest C++ standard ISO/IEC 14882:2014.
Note: the new C++ library binary object interface is incompatible with earlier versions of the product.Unicode support
The Unicode standard for consistent encoding, representation, and handling of text is now supported. This means that you can use Unicode characters (alphabetic, numeric, symbols, emoji, etc) in the source code.Stack protection
The IAR C/C++ compiler for RL78 now supports stack protection. A canary value will be placed between the stack variables and the return address so that the system can detect corruption of a function return address before the function returns to that address. The compiler will use heuristic to determine whether a function needs stack protection or not. If any defined local variable has the array type or a structure type that contains a member of array type, the function will need stack protection. See the IAR C/C++ Development Guide for more information.
3.10.1 2017-09-15
Program corrections
-
[EWRL78-659] The compiler might generate an internal error if the --mfc option is used and more that one interrupt declaration is using the same interrupt vector.
-
[EWRL78-649] The compiler can sometimes combine an INCW and an ADDW instruction even if a following instruction depends on correct flags from the ADDW instruction.
-
[EWRL78-644] The compiler sometimes removes 16-bit compares in if statements if the value of the variable - instead of being re-read - is restored by adding a constant before the compare.
See also EWRL78-649 -
[EWRL78-642] Switch statements on type long long are not supported by the compiler.
-
[EWRL78-639] Returning a long long value and storing it in a struct can cause a common subexpression elimination temporary to be used, which in turn can cause an internal error.
-
[EWRL78-635] Reading the value of an object pointed to by a signed short cast to a far pointer can cause an internal error.
-
[EWRL78-634] Two different interrupt functions that uses the same vector can cause an internal error.
See also EWRL78-538 -
[EWRL78-632] Absolute placement of initialized constants in the near data area (0xF0000-0xFFFFF) will generate an error. If you use this area for data flash, you should change this error to a warning.
-
[EWRL78-576] The cross call optimization might move the NOP instruction that follows a DIVWU/DIVHU instruction, which can lead to intermittent errors.
-
[EWRL78-565] The command line option --no_crosscall has been renamed to --no_cross_call to match the documentation and conform to other IAR products.
-
[EWRL78-564] Casting from a far function pointer to a huge data pointer causes an internal error.
-
[EWRL78-547] On optimization level High, function-local static variables that are assigned only the constants 0 and 1 but initialized with another value, can be optimized incorrectly.
-
[EWRL78-538] Two interrupt functions that use the same vector might cause an internal error without a previous warning.
See also EWRL78-634 -
[EWRL78-519] MISRA-C:2004 rule 12.4 does not work for && expressions where a volatile variable is the second expression.
-
[EWRL78-507] Casting a near pointer to a short, and then casting it to a far pointer, and then to a long, might cause an internal error.
See also EWRL78-506 -
[EWRL78-506] Casting a near pointer to a short, and then casting it to a far pointer, and then to a long, might cause an internal error.
See also EWRL78-507
New features
- The __packed type attribute is now supported to specify a data alignment of 1 for a data type.
2.21.1 2016-05-31
Program corrections
-
[EWRL78-637] A sequence of common subexpressions, containing pointer indirections, can be optimized incorrectly if the sequence occurs in parallel flows of control. The problem is triggered when the optimization "loop unrolling" has been disabled, for loops only, either:
1) with indirect pointer access. Example: *(p + index] or
2) for array constructs. Example: p[index]
that appear more than once and that are candidates for common subexpression elimination. A workaround is to use the optimization "loop unrolling", i.e. do not set the option --no_unroll. -
[EWRL78-597] Sign-extending a signed int or short register variable to a long, might destroy the register variable if it is located in register AX.
-
[EW25997] An internal error will be generated for the following statement:
asm("MOVW SP, #LWRD(sfe(""CSTACK""))"); -
[EW26007] Floating point comparison fails if the difference between the operands is one bit only. Example: -16777215.0F <= -16777216.0F. A workaround is to compare with a (const) volatile variable or an external const declared variable instead of a constant.
-
[EW25999] Casting an SFR address to far memory and accessing a 1-bit bitfield will in some case generate an illegal state error.
2.20.1 2015-12-17
Program corrections
-
[EW25715] Huge-declared objects that are initialized and larger than 64 KByte generate an error.
-
[EW25690], [EW25691], [EW25692] A number of small changes have been implemented to better comply with the Renesas ABI (Application Binary Interface).
New features
-
Stack usage analysis
With stack usage analysis enabled, a stack usage section will be added to the linker map file with listings of the maximum stack depth for each call graph root. The analysis process can be customized to take into account such constructs as calls via function pointers and recursion. The output can optionally be generated in XML format for post-processing activities.
2.10.4 2015-11-05
Program corrections
-
[EW25763] Some instructions that have one operand of type imm[BC] might generate incorrect offsets to BC if the offset is a constant (not a label).
-
[EW25713] Far pointers that have a constant value (known at compile time) and that point into the short-address area can in some cases generate an internal error.
2.10.3 2015-08-31
Program corrections
-
[EW25541] The following statement generates an internal error: (void)(unsigned short int )( (*(unsigned short *)0xF06E6) );. The workaround is either to remove the (void) cast or make the pointer cast volatile.
-
[EW25593] Interrupt routines using the new Renesas calling convention (v2) fail to save the scratch registers.
-
[EW25644] The CPU information in the ELF object file format header field e_flags is not set up correctly.
2.10.2 2015-07-10
Program corrections
-
[EW25533] Reading a 16-bit SFR that is located in the memory range 0xFFF00-0xFFF1F might generate an internal error.
-
[EW25516] Accessing signed long bitfields of size 16 bits might generate illegal code.
Example:long b; struct { long a : 16; } st; b = st.a;
2.10.1 2015-06-15
Program corrections
-
[EWRL78-654, EWRL78-656] The optimizer considers all labels of long long constants (i.e. internally generated long long constants) to be equal which can cause cross call and cross jump to fail.
-
[EWRL78-643] Recursive functions with a parameter consisting of a recursive struct can cause an internal error.
-
[EW24996] Tail recursive calls before a switch statement will in some cases generate an internal error.
-
[EW25000] Bitfield variables can in some rare cases be optimized incorrectly on optimization level high, if there are multiple assignments to two or more bitfield members and at least one of them is assigned a constant.
-
[EW24994] When a bitfield member is assigned a constant value followed by an assignment to another bitfield member in the same variable, an internal error is in rare cases generated on optimization level high.
-
[EW25002] Cases where multiple bitfields are assigned in one statement, for example a.bitfld1 = b.bitfld2 = c.bitfld3 = 1;, might be optimized incorrectly on optimization level high.
-
[EW25100] Setting up the hardware multiplier/divider manually from C source code on S2 core devices (--core=rl78_1) might cause incorrect code to be generated.
-
[EW24733] The compiler does not check the MISRA-C:2004 rule 10.6 correctly. It bases the check on the use of the constant instead of its type.
-
[EW24883] MISRA-C:2004 rule 10.1 is falsely triggered for an implicit cast from a _Bool data type to an integer or floating point data type.
-
[EW24359] Exceeding the allowed limit of parameters passed to a function might generate a compiler error.
-
[EW24361] An internal error [Front end]: assertion failed: clone_macro_text_map_entries map entry pointer past end of entries array is generated for the following source code example:
#define main() int main #define mainbody () { return 0; } mainbody
-
[EW25288] Several support routines for long operations might generate an out of range error at link time when using far runtime library calls.
-
[EW25270] C switch statements with long long variables are not supported.
-
[EW25227] The compiler emits an error when processing an out of class definition of a const or volatile member function of a class with a class memory.
Example:struct __far S { int fun() const; int mS; }; int S::fun() const { return mS; }
-
[EW25225] When using multi-file compilation (--mfc), conflict between fields of a file or namespace scope anonymous union/struct and entities defined in another module is not detected, which can lead to internal errors in later processing.
New features
-
Renesas RL78 ABI compliance
-
Double-precision floating-point format
1.40.6 2014-11-12
Program corrections
-
[EW25080] The compiler adds a NOP instruction for the RL78 S3 MCU core after every DIVWU and DIVHU instruction as a workaround for an error in the MCU. However, the instruction scheduler will in some cases move an instruction in between the DIVWU/DIVHU instruction and the NOP. A workaround is to use the --no_scheduling option.
-
[EW24999] Copying a string literal to a char array using strcpy might cause incorrect inline code to be generated. (This problem was only partly corrected in v1.40.5).
1.40.5 2014-10-24
New features
-
[EW24990] Improved code generation for bit handling.
Program corrections
-
[EW25004] On optimization level high, loops containing an expression where the result of the expression depends on unsigned overflow of a smaller type can in some case be optimized incorrectly.
-
[EW25030] Long division using the DIVWU instruction will in rare cases destroy other register variables contained in the HL or DE registers.
-
[EW24999] Copying a string literal to a char array using strcpy might cause incorrect inline code to be generated.
-
[EW24995] Comparing a near data pointer with (void __near *) -1 will in some cases generate an internal error.
1.40.3 2014-09-17
Program corrections
-
[EW24899] The compiler can erroneously report a non-existing violation of MISRA-C:2004 rule 14.10 (final else after if...else if) in some cases involving nested if statements.
-
[EW24819] Dividing a long long constant with a variable fails. Example: 1234567ULL / var.
-
[EW24683] The pragma #pragma default_variable_attributes is ignored when the keyword const is used on the variable following the pragma.
-
[EW24655] Copying a 1-bit bitfield to a 1-bit bitfield in a struct accessed via a pointer fails.
-
[EW24860] __huge constant data is placed in the NEAR_CONST segment instead of in the HUGE_CONST segment.
-
[EW25006] Instead of assigning a correct return value, the input parameter value is used as return value in the following example:
int b = 1; int func( int a ) { return( a = b++ ); }
1.40.2 2014-06-10
New features
-
Japanese translation.
1.40.1 2014-04-10
Program corrections
-
[EW24357] The compiler sometimes generates an internal error just after the error Error[Pe066]: enumeration value is out of "int" range.
-
[EW24511] Nestling boolean expressions can in rare cases cause an illegal state error on lower optimization levels.
-
[EW24362] The compiler sometimes generates an internal error just after the error Error[Pe078]: a parameter declaration may not have an initializer.
-
[EW24363] An error for an enum constant with an illegal value is sometimes followed by an internal error.
-
[EW24366] The compiler sometimes generates the internal error Internal Error: [PaType - MemoryAttribute]: no memory attribute set. after a user code error.
-
[EW24368] The compiler sometimes generates an internal error just after the error Error[Pe168]: a function type is not allowed here, for an erroneous bitfield type.
-
[EW24298] The assembler replacement routines for 16-bit signed division and modulo operations do not preserve the BC register correctly.
-
[EW24573] The rewritten floating-point routines are not fully compatible with the __far run-time library calls option and this causes a linker error.
New features
-
The compiler now supports the C++ feature Multiple inheritance.
-
The compiler now supports the __huge keyword to enable access beyond a 64-Kbyte boundary.
-
The C/C++ Compiler User Guide has been updated to reflect the product changes.
1.30.7 2014-01-23
Program corrections
-
[EW24383] An expression (e) containing an auto variable (v) and one or more indirect accesses could be optimized incorrectly if the expression was preceded by a statement where v is assigned the result of a function call, and e contains the only use of v (before v is assigned another value).
1.30.6 2013-12-18
Program corrections
-
[EW24389] The keyword __no_bit_access does not work correctly with an expression like this:
*(volatile ushort __no_bit_access *)(ushort)(0xFFF10U)
1.30.5 2013-10-11
Program corrections
-
[EW24198] Loading a far pointer via another far pointer might generate faulty code.
New features
-
Two new pragmas, #pragma default_function_attributes and #pragma default_variable_attributes, are introduced to set default segment placement and type and object attributes for variables and functions. See section User guide corrections for more information.
1.30.4 2013-09-06
Program corrections
-
[EW24151] On optimization level high, casting a near pointer to a far pointer via a unsigned/signed short might result in a near to far cast instead of a zero-extend cast.
-
[EW24136] Accessing a packed struct member might result in an internal error if the size of the member is two bytes or larger.
-
[EW24074] The memory tracking system does not properly canonicalize the source address when looking up data during optimizations. This can lead to missed optimizations as well as incorrect optimzations.
1.30.3 2013-06-14
Program corrections
-
[EW23939] Bit access on pointers is sometimes performed even though the __no_bit_access keyword is used.
-
[EW23965] On high optimization, a variable (v) can be optimized incorrectly if v is incremented with a constant value inside a do loop, the do loop has a computable trip count, the do loop is surrounded by another loop with a computable trip count, and v is not used inside either of the two loops, except for the increment.
-
[EW23972] An indirect postincrement of the result of a postincrement ( (*p++)++ ), is not handled correctly.
1.30.2 2013-03-15
Program corrections
-
[EW23562] Placing __near const variables in a user defined segment, and using rom location=ram causes the compiler to ignore the user defined segment and copy the const variable to RAM.
-
[EW23421] An inline assembler statement following immediately after a constructor call, destructor call, or an intrinsic library function that returns the first parameter, triggers an internal error.
New features
-
The compiler command line options --aggressive_inlining and --aggressive_unrolling have been removed and are replaced by the new option --no_size_constraints.
-
A new Call Graph window has been added. It is browsable and displays all calls made to and from each function from any source file in the active project.
-
Code generated for floating-point operations is now faster compared to the previous version.
1.30.1 2013-03-01
-
Pre-release.
1.20.4 2012-10-30
Program corrections
-
[EW23478] The extended keyword __no_bit_access did not work for auto variables.
-
[EW23550] A 16-bit ADD/SUB with an immediate could under rare circumstances destroy the contents of a register variable.
1.20.3 2012-08-09
Program corrections
-
[EW23320] Pointer expressions of the kind *(Base - imm*variable) no longer cause incorrect code to be generated using the imm[BC] address mode.
-
[EW23224] Using memcpy with sizeof(segment) as size parameter no longer causes an internal error.
-
[EW23344] The compiler no longer generates faulty code when casting a near data pointer to a far pointer. This could result in the value 0 instead of 15 on lower optimization levels.
1.20.1 2012-04-13
Program corrections
-
[EW22717] The build process no longer stops prematurely for certain code examples where macros are expanded within macros.
-
[EW23051] Near pointer indexing no longer causes incorrect use of the word[BC] address mode if it is on the form array[-var] or array[0x100-var].
-
[EW22844] Defining the same label name in several different inline assembler statements no longer causes an internal error in the compiler. Labels in inline assembler statements are now automatically renamed to avoid this problem.
-
[EW22723] Using memcpy with a destination in the auto area no longer causes incorrect code on high optimization levels.
-
[EW22669] MISRA-C checker errors without a known file position no longer cause the compiler to crash when the option --header_context is used.
-
[EW22203] The total number of errors and warnings presented by the compiler was doubled compared to the real amount.
-
[EW23118] Common sub-expressions that contain side effects no longer cause incorrect code to be generated.
New features
-
Code generated for integer arithmetics and floating-point operations is now several times faster compared to the previous version. Code inlining has also been improved in the case of optimizing for speed.
-
A compiler option, --generate_far_runtime_library_calls, has been added to make it possible to place libraries (the RCODE segment) in far code memory.
-
An object attribute called __ro_placement has been added. This is useful, for example, for placing a const volatile variable in flash memory residing in ROM.
1.10.4 2011-08-11
Program corrections
-
[EW22606] The compiler could generate an illegal address mode if an absolute placed variable was indexed with a negative value.
-
[EW22607] Accessing far variables from within an interrupt routine could generate an internal error.
1.10.2 2011-06-23
Program corrections
-
[EW22480] When casting an address of a short address variable to a far pointer, the compiler no longer optimizes the code in a way so that an internal error is generated.
1.10.1 2011-03-01
-
Initial release.