This is the mail archive of the gcc@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]

i386 return address patch


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
 


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