From: Trevor Saunders <tbsaunde+...@tbsaunde.org>

gcc/ChangeLog:

2015-10-10  Trevor Saunders  <tbsaunde+...@tbsaunde.org>

        * defaults.h (DYNAMIC_CHAIN_ADDRESS): New default definition.
        * builtins.c (expand_builtin_return_addr): Adjust.
---
 gcc/builtins.c | 2 --
 gcc/defaults.h | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/builtins.c b/gcc/builtins.c
index bd95acb..750488e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -799,9 +799,7 @@ expand_builtin_return_addr (enum built_in_function 
fndecl_code, int count)
     {
       /* Assume the dynamic chain pointer is in the word that the
         frame address points to, unless otherwise specified.  */
-#ifdef DYNAMIC_CHAIN_ADDRESS
       tem = DYNAMIC_CHAIN_ADDRESS (tem);
-#endif
       tem = memory_address (Pmode, tem);
       tem = gen_frame_mem (Pmode, tem);
       tem = copy_to_reg (tem);
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 5f1ea76..80ad35c 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1285,6 +1285,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. 
 If not, see
 #define SETUP_FRAME_ADDRESSES() do { } while (0)
 #endif
 
+#ifndef DYNAMIC_CHAIN_ADDRESS
+#define DYNAMIC_CHAIN_ADDRESS(x) (x)
+#endif
+
 #ifdef GCC_INSN_FLAGS_H
 /* Dependent default target macro definitions
 
-- 
2.6.1

Reply via email to