aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>1995-02-23 22:23:33 +0000
committerMike Stump <mrs@gcc.gnu.org>1995-02-23 22:23:33 +0000
commitf33985c6ed8e255b09f0274145ac916d4331b01e (patch)
tree28c1d5335799e1214dda4af061066938ee9d16b2
parentd14a6d05b224eeba4b3352e993e12226b9205784 (diff)
downloadgcc-f33985c6ed8e255b09f0274145ac916d4331b01e.zip
gcc-f33985c6ed8e255b09f0274145ac916d4331b01e.tar.gz
gcc-f33985c6ed8e255b09f0274145ac916d4331b01e.tar.bz2
rs6000.h (RETURN_ADDR_RTX): Add definition to support __builtin_return_address and __builtin_frame_address...
* rs6000.h/rs6000.h (RETURN_ADDR_RTX): Add definition to support __builtin_return_address and __builtin_frame_address on the rs6000. This is necessary to support exception handling in g++ on the rs6000. Fixes eh6.C on rs6000. From-SVN: r9054
-rw-r--r--gcc/config/rs6000/rs6000.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 55f52cb..2a7ddf6 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1151,6 +1151,27 @@ struct rs6000_args {int words, fregno, nargs_prototype; };
force_reg (SImode, (CXT))); \
}
+/* Definitions for __builtin_return_address and __builtin_frame_address.
+ __builtin_return_address (0) should give link register (65), enable
+ this. */
+/* This should be uncommented, so that the link register is used, but
+ currently this would result in unmatched insns and spilling fixed
+ registers so we'll leave it for another day. When these problems are
+ taken care of one additional fetch will be necessary in RETURN_ADDR_RTX.
+ (mrs) */
+/* #define RETURN_ADDR_IN_PREVIOUS_FRAME */
+/* The current return address is in link register (65). The return address
+ of anything farther back is accessed normally at an offset of 8 from the
+ frame pointer. */
+#define RETURN_ADDR_RTX(count, frame) \
+ ((count == -1) \
+ ? gen_rtx (REG, Pmode, 65) \
+ : copy_to_reg (gen_rtx (MEM, Pmode, \
+ memory_address (Pmode, \
+ plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \
+ memory_address (Pmode, frame))), \
+ 8)))))
+
/* Definitions for register eliminations.
We have two registers that can be eliminated on the RS/6000. First, the