aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Shinwell <shinwell@codesourcery.com>2006-06-12 12:56:52 +0000
committerMark Shinwell <shinwell@codesourcery.com>2006-06-12 12:56:52 +0000
commit7279b9aa4dfa300e6b075d9a3657025f56c09663 (patch)
tree0a00b7c5eddbe5d1b9ebfe19260878e50329d448
parent0bc5cccdc7b8e337d53685a46da1e669866484f8 (diff)
gcc/
* builtins.c (expand_builtin_return_addr): Only use frame_pointer_rtx when count == 0 and we are expanding __builtin_return_address. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@114567 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/builtins.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 475c36fccae..45696359c28 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-12 Mark Shinwell <shinwell@codesourcery.com>
+
+ * builtins.c (expand_builtin_return_addr): Only use
+ frame_pointer_rtx when count == 0 and we are expanding
+ __builtin_return_address.
+
2006-06-12 Fred Fish <fnf@specifix.com>
* config/mips/mips.c (mips_file_start): Create special section
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 603106a6751..80f2fbbf4b7 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -509,12 +509,16 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
#else
rtx tem;
- /* For a zero count, we don't care what frame address we return, so frame
- pointer elimination is OK, and using the soft frame pointer is OK.
- For a nonzero count, we require a stable offset from the current frame
- pointer to the previous one, so we must use the hard frame pointer, and
+ /* For a zero count with __builtin_return_address, we don't care what
+ frame address we return, because target-specific definitions will
+ override us. Therefore frame pointer elimination is OK, and using
+ the soft frame pointer is OK.
+
+ For a non-zero count, or a zero count with __builtin_frame_address,
+ we require a stable offset from the current frame pointer to the
+ previous one, so we must use the hard frame pointer, and
we must disable frame pointer elimination. */
- if (count == 0)
+ if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS)
tem = frame_pointer_rtx;
else
{