From a8a6b3dfd3ec2794a21f34169678a48ed8ecae61 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Wed, 22 Apr 2015 00:44:43 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/defaults.h | 5 +++++ gcc/except.c | 14 +++++++------- 3 files changed, 19 insertions(+), 7 deletions(-) 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; } -- 2.30.2