Hi.
__builtin_return_address is extremely useful for target error reporting.
e.g. a function can be called(or trapped) to report error in another
part of program. This allows such routines to determine the address of
the caller without using naked asm functions.
You are correct, that return address will only give 16bit pointer. But
that covers most uses.
It would seem easier to implement than create documents and disable all
current and future testcases that use it. That would seem to be
confirmed by the fact that bug reports have been outstanding since 2005.
Of course, Eric and other AVR users may disagree.
Word or byte address return "__builtin_return_address"?
I consider that, it will be better that it returned the word address.
For those architectures where it cannot return the correct address, the
"__builtin_return_address" should be disabled.
+static void avr_init_builtins (void);
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS avr_init_builtins
+void
+avr_init_builtins (void)
+{
+ if (AVR_HAVE_EIJMP_EICALL) // if "__builtin_return_address" return word
address.
+ {
+ disable_builtin_function ("return_address");
+ }
+}
Anatoly.
------------------------------------------------------------------------
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list