public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* i386 return address patch
@ 1997-09-30 11:10 Richard Henderson
  0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 1997-09-30 11:10 UTC (permalink / raw)
  To: kenner, egcs, libc-hacker

Tue Sep 30 11:05:47 1997  Richard Henderson  <rth@cygnus.com>

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


--- config/i386/i386.h.orig	Thu Jul 31 13:26:06 1997
+++ config/i386/i386.h	Tue Sep 30 11:02:40 1997
@@ -2366,6 +2366,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
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-09-30 11:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-30 11:10 i386 return address patch Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).