Commit dda69cbf by Mark Shinwell Committed by Mark Shinwell

builtins.c (expand_builtin_return_addr): Only use frame_pointer_rtx when count…

builtins.c (expand_builtin_return_addr): Only use frame_pointer_rtx when count == 0 and we are expanding...

gcc/
	* builtins.c (expand_builtin_return_addr): Only use
	frame_pointer_rtx when count == 0 and we are expanding
	__builtin_return_address.

From-SVN: r114567
parent 0901c5a3
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> 2006-06-12 Fred Fish <fnf@specifix.com>
* config/mips/mips.c (mips_file_start): Create special section * config/mips/mips.c (mips_file_start): Create special section
......
...@@ -509,12 +509,16 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count) ...@@ -509,12 +509,16 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
#else #else
rtx tem; rtx tem;
/* For a zero count, we don't care what frame address we return, so frame /* For a zero count with __builtin_return_address, we don't care what
pointer elimination is OK, and using the soft frame pointer is OK. frame address we return, because target-specific definitions will
For a nonzero count, we require a stable offset from the current frame override us. Therefore frame pointer elimination is OK, and using
pointer to the previous one, so we must use the hard frame pointer, and 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. */ we must disable frame pointer elimination. */
if (count == 0) if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS)
tem = frame_pointer_rtx; tem = frame_pointer_rtx;
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment