I'm having a problem using -finstrument-functions on an XMEGA 128A3U. I get "'builtin_return_address' contains only 2 bytes of address [enabled by default]" when compiling. My functions are as follows:
void __cyg_profile_func_enter (void *func, void *caller) __attribute__((no_instrument_function)); void __cyg_profile_func_enter (void *func, void *caller) { } void __cyg_profile_func_exit (void *func, void *caller) __attribute__((no_instrument_function)); void __cyg_profile_func_exit (void *func, void *caller) { }
I guess this is because with 128k of flash memory, function pointers can be larger than 16 bits. Since these are built-in functions I'm not sure how to work around this.
I could disable the warning but then the addresses would wrap around. I tried changing "void *" to "uint32_t" but of course it conflicts with the builtin prototype. It seems like maybe it's just broken on AVRs with >16 bit program counters.
Incidentally, using instrument functions also causes builtin_avr_delay_cycles() to fail compilation as it thinks that the delay amount is no longer a compile time constant. In other words. _delay_ms(1) doesn't compile.