Index: gcc/config/mmix/crtn.asm =================================================================== --- gcc/config/mmix/crtn.asm (revision 2) +++ gcc/config/mmix/crtn.asm (working copy) @@ -69,6 +69,8 @@ #endif /* __MMIX_ABI_GNU__ */ +thread_pointer GREG + % Provide last part of _init and _fini. % The return address is stored in the topmost stored register in the Index: gcc/config/mmix/mmix.md =================================================================== --- gcc/config/mmix/mmix.md (revision 2) +++ gcc/config/mmix/mmix.md (working copy) @@ -1096,7 +1096,9 @@ in the call, and we set it back after every call (all but one setting will be optimized away), integrity is maintained. */ operands[3] - = mmix_get_hard_reg_initial_val (Pmode, + = current_function_calls_setjmp? + mmix_return_addr_rtx (0, NULL_RTX): + mmix_get_hard_reg_initial_val (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM); /* FIXME: There's a bug in gcc which causes NULL to be passed as @@ -1133,7 +1135,9 @@ in the call, and we set it back after every call (all but one setting will be optimized away), integrity is maintained. */ operands[4] - = mmix_get_hard_reg_initial_val (Pmode, + = current_function_calls_setjmp? + mmix_return_addr_rtx (0, NULL_RTX): + mmix_get_hard_reg_initial_val (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM); /* FIXME: See 'call'. */ Index: gcc/config/mmix/mmix.c =================================================================== --- gcc/config/mmix/mmix.c (revision 2) +++ gcc/config/mmix/mmix.c (working copy) @@ -64,9 +64,10 @@ information. FIXME: Some tweak to leaf_function_p might be preferable. */ #define MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS \ + (current_function_calls_setjmp || \ (flag_exceptions \ && ((reload_completed && df_regs_ever_live_p (MMIX_rJ_REGNUM)) \ - || !leaf_function_p ())) + || !leaf_function_p ()))) #define IS_MMIX_EH_RETURN_DATA_REG(REGNO) \ (current_function_calls_eh_return \