Hm...
Is avr-gcc for avr6 ready to use?
I have try avr-gcc 4.4-20080404 (4.3.0 does not support avr6)
with binutils 2.18. In result the small program without any
EEPROM usage and without any inline functions gives incorrect
code:
/* avr-gcc 4.4-20080404 + binutils 2.18 produce incorrect code: the foo4()
function stores 0 value to 'vp' variable.
Options: -W -Wall -Os -mmcu=atmega2560
*/
#define BIGCODE() asm volatile (".rept 30000\n\tnop\n\t.endr")
void (* volatile vp) (void);
__attribute__((noinline)) void foo1 (void) { BIGCODE(); vp = foo1; }
__attribute__((noinline)) void foo2 (void) { BIGCODE(); vp = foo2; }
__attribute__((noinline)) void foo3 (void) { BIGCODE(); vp = foo3; }
__attribute__((noinline)) void foo4 (void) { BIGCODE(); vp = foo4; }
int main ()
{
foo1 ();
foo2 ();
foo3 ();
foo4 ();
return 0;
}
I will see the bug report later.
Dmitry.
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev