From cbc7d031c4a563565f3351b36fbcb323567627fc Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Wed, 22 Apr 2015 00:44:48 +0000 Subject: [PATCH] provide default for MASK_RETURN_ADDR gcc/ChangeLog: 2015-04-21 Trevor Saunders * defaults.h (MASK_RETURN_ADDR): New definition. * except.c (expand_builtin_extract_return_addr): Remove ifdef MASK_RETURN_ADDR. From-SVN: r222299 --- gcc/ChangeLog | 6 ++++++ gcc/defaults.h | 4 ++++ gcc/except.c | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc46aa99f99..acb026b1577 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-21 Trevor Saunders + + * defaults.h (MASK_RETURN_ADDR): New definition. + * except.c (expand_builtin_extract_return_addr): Remove ifdef + MASK_RETURN_ADDR. + 2015-04-21 Trevor Saunders * defaults.h (RETURN_ADDR_OFFSET): New definition. diff --git a/gcc/defaults.h b/gcc/defaults.h index 767901acf29..843d7e20efe 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -388,6 +388,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define RETURN_ADDR_OFFSET 0 #endif +#ifndef MASK_RETURN_ADDR +#define MASK_RETURN_ADDR NULL_RTX +#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 750deb56bfe..7e6591bfc55 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2185,9 +2185,9 @@ expand_builtin_extract_return_addr (tree addr_tree) } /* First mask out any unwanted bits. */ -#ifdef MASK_RETURN_ADDR - expand_and (Pmode, addr, MASK_RETURN_ADDR, addr); -#endif + rtx mask = MASK_RETURN_ADDR; + if (mask) + expand_and (Pmode, addr, mask, addr); /* Then adjust to find the real return address. */ if (RETURN_ADDR_OFFSET) -- 2.30.2