From: Jim Wilson Date: Tue, 19 Dec 1995 23:25:43 +0000 (-0800) Subject: (return_address_pointer_rtx): New global variable. X-Git-Tag: misc/cutover-egcs-0~3226 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=a4417a863114d5c9c31c86ed71cc4294d650733c;p=gcc.git (return_address_pointer_rtx): New global variable. (gen_rtx, init_emit_once): Add support for it. From-SVN: r10817 --- diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 9600f2f63aad..3f4958d7ed9b 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -159,6 +159,10 @@ rtx static_chain_rtx; /* (REG:Pmode STATIC_CHAIN_REGNUM) */ rtx static_chain_incoming_rtx; /* (REG:Pmode STATIC_CHAIN_INCOMING_REGNUM) */ rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */ +/* This is used to implement __builtin_return_address for some machines. + See for instance the MIPS port. */ +rtx return_address_pointer_rtx; /* (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM) */ + rtx virtual_incoming_args_rtx; /* (REG:Pmode VIRTUAL_INCOMING_ARGS_REGNUM) */ rtx virtual_stack_vars_rtx; /* (REG:Pmode VIRTUAL_STACK_VARS_REGNUM) */ rtx virtual_stack_dynamic_rtx; /* (REG:Pmode VIRTUAL_STACK_DYNAMIC_REGNUM) */ @@ -344,6 +348,11 @@ gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...)) if (arg_pointer_rtx && regno == ARG_POINTER_REGNUM && mode == Pmode && ! reload_in_progress) return arg_pointer_rtx; +#endif +#ifdef RETURN_ADDRESS_POINTER_REGNUM + if (return_address_pointer_rtx && regno == RETURN_ADDRESS_POINTER_REGNUM + && mode == Pmode && ! reload_in_progress) + return return_address_pointer_rtx; #endif if (stack_pointer_rtx && regno == STACK_POINTER_REGNUM && mode == Pmode && ! reload_in_progress) @@ -3392,6 +3401,11 @@ init_emit_once (line_numbers) else arg_pointer_rtx = gen_rtx (REG, Pmode, ARG_POINTER_REGNUM); +#ifdef RETURN_ADDRESS_POINTER_REGNUM + return_address_pointer_rtx = gen_rtx (REG, Pmode, + RETURN_ADDRESS_POINTER_REGNUM); +#endif + /* Create the virtual registers. Do so here since the following objects might reference them. */