Patch from Richard Henderson to make __builtin_return_address(0) work.

* i386.h (RETURN_ADDR_RTX): New definition that works for
	__builtin_return_address(0) and -fomit-frame-pointer.

From-SVN: r15835
This commit is contained in:
Richard Henderson 1997-10-02 21:15:56 -07:00 committed by Jim Wilson
parent 808d0b1063
commit e414ab2935
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Oct 2 21:15:03 1997 Richard Henderson <rth@cygnus.com>
* i386.h (RETURN_ADDR_RTX): New definition that works for
__builtin_return_address(0) and -fomit-frame-pointer.
Wed Oct 1 13:43:53 1997 Jim Wilson <wilson@cygnus.com>
Bring over from FSF.

View file

@ -2370,6 +2370,12 @@ number as al, and ax.
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx (MEM, VOIDmode, gen_rtx (REG, VOIDmode, STACK_POINTER_REGNUM))
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
? gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, arg_pointer_rtx, GEN_INT(-4)))\
: gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, (FRAME), GEN_INT(4))))
/* PC is dbx register 8; let's use that column for RA. */
#define DWARF_FRAME_RETURN_COLUMN 8