This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH,TARGET]PR21078,21080 Fix AVR builtin_return_address


Hi Anatoly,

The attached patch corrects for builtin_return_address bug. This will now give correct return address for current function (count = 0).
It will output warning message for AVR_3_BYTE_PC - where Pmode value cannot support 3 byte PC.


foo.c:159:35: warning: 'builtin_return_address' contains only 2 bytes of address

Other levels (count >0) are not supported and gcc will now (correctly) issue warning:

foo.c:159:35: warning: unsupported argument to '__builtin_return_address'

The assembler file also includes calculated stack size.

/* prologue: function */
/* frame size = 0 */
/* stack size = 1 */


Ok for 4.5?


Could you also approve to backport to 4.4 and 4.3





2009-11-09 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>

  PR target/21078, 21080
  * avr.c (avr_return_addr_rtx): New function for builtin_return_address.
   (expand_prologue): Calculate stack usage.
   (avr_asm_function_end_prologue): Output stack size and offset label.
   (stack_usage): New static variable for stack size.
  * avr.h (RETURN_ADDR_RTX): Replace.
   *avr-protos.h (avr_return_addr_rtx): New function.

Attachment: newreturnaddr.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]