From: Trevor Saunders Date: Wed, 22 Apr 2015 00:44:43 +0000 (+0000) Subject: provide default for RETURN_ADDR_OFFSET X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8a6b3dfd3ec2794a21f34169678a48ed8ecae61;p=gcc.git provide default for RETURN_ADDR_OFFSET gcc/ChangeLog: 2015-04-21 Trevor Saunders * defaults.h (RETURN_ADDR_OFFSET): New definition. * except.c (expand_builtin_extract_return_addr): Remove ifdef RETURN_ADDR_OFFSET. (expand_builtin_frob_return_addr): Likewise. From-SVN: r222298 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b7729ac05e..dc46aa99f99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-04-21 Trevor Saunders + + * defaults.h (RETURN_ADDR_OFFSET): New definition. + * except.c (expand_builtin_extract_return_addr): Remove ifdef + RETURN_ADDR_OFFSET. + (expand_builtin_frob_return_addr): Likewise. + 2015-04-21 Trevor Saunders * cfgrtl.c (rtl_merge_blocks): Change #if HAVE_cc0 to if (HAVE_cc0) diff --git a/gcc/defaults.h b/gcc/defaults.h index 911c2f8df13..767901acf29 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -383,6 +383,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM #endif +/* Offset between the eh handler address and entry in eh tables. */ +#ifndef RETURN_ADDR_OFFSET +#define RETURN_ADDR_OFFSET 0 +#endif + /* If we have named section and we support weak symbols, then use the .jcr section for recording java classes which need to be registered at program start-up time. */ diff --git a/gcc/except.c b/gcc/except.c index e05e1969899..750deb56bfe 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2190,9 +2190,8 @@ expand_builtin_extract_return_addr (tree addr_tree) #endif /* Then adjust to find the real return address. */ -#if defined (RETURN_ADDR_OFFSET) - addr = plus_constant (Pmode, addr, RETURN_ADDR_OFFSET); -#endif + if (RETURN_ADDR_OFFSET) + addr = plus_constant (Pmode, addr, RETURN_ADDR_OFFSET); return addr; } @@ -2208,10 +2207,11 @@ expand_builtin_frob_return_addr (tree addr_tree) addr = convert_memory_address (Pmode, addr); -#ifdef RETURN_ADDR_OFFSET - addr = force_reg (Pmode, addr); - addr = plus_constant (Pmode, addr, -RETURN_ADDR_OFFSET); -#endif + if (RETURN_ADDR_OFFSET) + { + addr = force_reg (Pmode, addr); + addr = plus_constant (Pmode, addr, -RETURN_ADDR_OFFSET); + } return addr; }