PATCH for sparc.h: Add stack bias to DYNAMIC_CHAIN_ADDRESS

Jeff Sturm jsturm@one-point.com
Fri Jun 14 07:58:00 GMT 2002


Fixes __builtin_return_address(n) for n > 1 on sparc64.

Bootstrapped & regression tested on sparcv9-sun-solaris2.8.

2002-06-14  Jeff Sturm  <jsturm@one-point.com>

	* config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS): Add
	SPARC_STACK_BIAS.

Index; config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.200
diff -u -p -r1.200 sparc.h
--- sparc.h	10 Jun 2002 22:35:55 -0000	1.200
+++ sparc.h	14 Jun 2002 14:49:59 -0000
@@ -1961,7 +1961,8 @@ do {									\
    return an rtx for the address of the word in the frame
    that holds the dynamic chain--the previous frame's address.
    ??? -mflat support? */
-#define DYNAMIC_CHAIN_ADDRESS(frame) plus_constant (frame, 14 * UNITS_PER_WORD)
+#define DYNAMIC_CHAIN_ADDRESS(frame)	\
+  plus_constant (frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
 
 /* The return address isn't on the stack, it is in a register, so we can't
    access it from the current frame pointer.  We can access it from the



More information about the Gcc-patches mailing list