diff mbox

[moxie] moxie EH fixes

Message ID 4CE89657.2090106@moxielogic.com
State New
Headers show

Commit Message

Anthony Green Nov. 21, 2010, 3:47 a.m. UTC
Changes to GCC's EH code in the past few months have introduced 
regressions in the moxie port.   I'm committing the attached patch so 
we're able to build and run the testsuite again.  EH is still broken, 
but at least it's measurable now.
2010-11-20  Anthony Green  <green@moxielogic.com>

	* config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Define.
	(EH_RETURN_DATA_REGNO): Define.
	(EH_RETURN_HANDLER_RTX): Define.
diff mbox

Patch

Index: gcc/config/moxie/moxie.h
===================================================================
--- gcc/config/moxie/moxie.h	(revision 166920)
+++ gcc/config/moxie/moxie.h	(working copy)
@@ -285,6 +285,21 @@ 
    pointer registers are already assumed to be used as needed.  */
 #define EPILOGUE_USES(R) (R == MOXIE_R5)
 
+/* A C expression whose value is RTL representing the location of the
+   incoming return address at the beginning of any function, before
+   the prologue.  */
+#define INCOMING_RETURN_ADDR_RTX					\
+  gen_frame_mem (Pmode,							\
+		 plus_constant (stack_pointer_rtx, UNITS_PER_WORD))
+
+/* Describe how we implement __builtin_eh_return.  */
+#define EH_RETURN_DATA_REGNO(N)	((N) < 4 ? (N+2) : INVALID_REGNUM)
+
+/* Store the return handler into the call frame.  */
+#define EH_RETURN_HANDLER_RTX						\
+  gen_frame_mem (Pmode,							\
+		 plus_constant (frame_pointer_rtx, UNITS_PER_WORD))
+
 /* Storage Layout */
 
 #define BITS_BIG_ENDIAN 0