The AVR IAR C/EC++ Compiler generates more efficient object code than previously possible. You must, however, you make some modifications to your existing source code before compiling it with the new AVR IAR C/EC++ Compiler, which may otherwise generate warnings or error messages.
Mainly, it is the notation of the language extensions that has changed. In some cases, the behavior and scope is also different. For example, some extended keywords and #pragma directives have been removed, while new ones have been added.
The new compiler technology also introduces new compiler options. This means that the project configuration in the IAR Embedded Workbench differs between the AT90S IAR C Compiler and the AVR IAR C/EC++ Compiler. It is therefore very important that you install the AVR IAR C/EC++ Compiler toolkit in a separate directory and that you keep all source files and project files apart. You will then be able to continue using the AT90S IAR C Compiler if you so wish.
Note: The mechanisms that control the initialization of segments differ completely between the two products. This means that you cannot use a CSTARTUP file from the AT90S IAR C Compiler in an AVR IAR C/EC++ Compiler project.
The AT90S IAR C Compiler supports only 4-byte doubles, while the AVR IAR C/EC++ Compiler supports both 4-byte and 8-byte doubles. Use the compiler option -–64bit_doubles to control the size of the double type.
If you do not use 8-byte doubles, it is not necessary not modify doubles in the source code.
In the AVR IAR C/EC++ Compiler, all extended keywords except asm start with two underscores, for example __near. This is taken care of by the migration macros in the file comp_a90.h.
Notice that the behavior of the following extended keywords has changed: memory specification keywords (for example, __near and __flash), __no_init, __interrupt, and __monitor.
In the AVR IAR C/EC++ Compiler, the sfrb and sfrw keywords are not available. Replace sfrb with volatile __io unsigned char and replace sfrw with volatile __io unsigned int.
Refer to the AVR IAR C/EC++ Compiler Reference Guide for details.
In the AVR IAR C/EC++ Compiler, the intrinsic functions start with two underscores, for example __enable_interrupt. This is taken care of by the migration macros in the file comp_a90.h.
The AT90S IAR C Compiler intrinsic functions _args$ and _argt$ are not available in the AVR IAR C/EC++ Compiler. Other AT90S IAR C Compiler intrinsic functions are available, but have new names in the AVR IAR C/EC++ Compiler. The translation of names is taken care of by the migration macros in the file comp_a90.h.
New intrinsic functions have been added in the AVR IAR C/EC++ Compiler. Refer to the AVR IAR C/EC++ Compiler Reference Guide for details.
interrupt void [vector] func()to
#pragma vector=vector __interrupt void func()
In the AVR IAR C/EC++ Compiler, all predefined symbols start and end with double underscores, for example __IAR_SYSTEMS_ICC__.
New predefined symbols have been added in the AVR IAR C/EC++ Compiler, for example, __ICCAVR__ which allows you to distinguish between the compilers. See the AVR IAR C/EC++ Compiler Reference Guide for details.