diff --git a/external/gpl3/gcc/dist/gcc/config/vax/elf.h b/external/gpl3/gcc/dist/gcc/config/vax/elf.h index 5ebda1678b75..30d8f4fc04d1 100644 --- a/external/gpl3/gcc/dist/gcc/config/vax/elf.h +++ b/external/gpl3/gcc/dist/gcc/config/vax/elf.h @@ -45,9 +45,6 @@ along with GCC; see the file COPYING3. If not see count pushed by the CALLS and before the start of the saved registers. */ #define INCOMING_FRAME_SP_OFFSET 0 -/* Offset from the frame pointer register value to the top of the stack. */ -#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0 - /* We use R2-R5 (call-clobbered) registers for exceptions. */ #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 2 : INVALID_REGNUM) diff --git a/external/gpl3/gcc/dist/gcc/config/vax/vax.c b/external/gpl3/gcc/dist/gcc/config/vax/vax.c index e8e10a635b6d..db18b96fc0f4 100644 --- a/external/gpl3/gcc/dist/gcc/config/vax/vax.c +++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.c @@ -184,6 +184,17 @@ vax_expand_prologue (void) offset += 4; } + if (crtl->calls_eh_return) + { + mask |= 0 + | ( 1 << EH_RETURN_DATA_REGNO(0) ) + | ( 1 << EH_RETURN_DATA_REGNO(1) ) + | ( 1 << EH_RETURN_DATA_REGNO(2) ) + | ( 1 << EH_RETURN_DATA_REGNO(3) ) + ; + offset += 4 * 4; + } + insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask))); RTX_FRAME_RELATED_P (insn) = 1; diff --git a/external/gpl3/gcc/dist/gcc/config/vax/vax.h b/external/gpl3/gcc/dist/gcc/config/vax/vax.h index 05dc44b17c78..677e39960024 100644 --- a/external/gpl3/gcc/dist/gcc/config/vax/vax.h +++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.h @@ -169,8 +169,9 @@ along with GCC; see the file COPYING3. If not see /* Base register for access to local variables of the function. */ #define FRAME_POINTER_REGNUM VAX_FP_REGNUM -/* Offset from the frame pointer register value to the top of stack. */ -#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0 +/* Offset from the argument pointer register value to the top of the + current call frame. */ +#define ARG_POINTER_CFA_OFFSET(FNDECL) 0 /* Base register for access to arguments of the function. */ #define ARG_POINTER_REGNUM VAX_AP_REGNUM diff --git a/external/gpl3/gcc/dist/gcc/config/vax/vax.md b/external/gpl3/gcc/dist/gcc/config/vax/vax.md index 4fc60eefbc6c..a146be6f7cee 100644 --- a/external/gpl3/gcc/dist/gcc/config/vax/vax.md +++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.md @@ -33,6 +33,8 @@ ; insn in the code. VUNSPEC_SYNC_ISTREAM ; sequence of insns to sync the I-stream VUNSPEC_PEM ; 'procedure_entry_mask' insn. + + VUNSPEC_EH_RETURN ]) (define_constants @@ -1468,6 +1470,38 @@ DONE; }") +;; Exception handling +;; This is used when compiling the stack unwinding routines. +(define_expand "eh_return" + [(use (match_operand 0 "general_operand"))] + "" +{ + if (GET_MODE (operands[0]) != word_mode) + operands[0] = convert_to_mode (word_mode, operands[0], 0); + emit_insn (gen_eh_set_retaddr (operands[0])); + DONE; +}) + +(define_insn_and_split "eh_set_retaddr" + [(unspec [(match_operand:SI 0 "general_operand")] VUNSPEC_EH_RETURN) + (clobber (match_scratch:SI 1 "=&r")) + ] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + /* the return address for the current frame is always at 0x10(%fp) */ + rtx tmp = plus_constant(Pmode, frame_pointer_rtx, 4 * UNITS_PER_WORD); + tmp = gen_rtx_MEM (word_mode, tmp); + MEM_VOLATILE_P(tmp) = 1; + tmp = gen_rtx_SET(tmp, operands[0]); + emit_insn(tmp); + DONE; +}) + + + (define_insn "nop" [(const_int 0)] ""