aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@act-europe.fr>2003-04-21 23:08:50 +0200
committerRichard Kenner <kenner@gcc.gnu.org>2003-04-21 17:08:50 -0400
commit6a48df451f671cc41481c85a2d1c4382a72e0832 (patch)
treea3f82160418feb45682cdb79d222ac7fd0af6ca7 /gcc/calls.c
parent26b84487c706cac8160048f5875f6a0e162a1095 (diff)
downloadgcc-6a48df451f671cc41481c85a2d1c4382a72e0832.zip
gcc-6a48df451f671cc41481c85a2d1c4382a72e0832.tar.gz
gcc-6a48df451f671cc41481c85a2d1c4382a72e0832.tar.bz2
calls.c (expand_call): Prevent sibcall optimization for calls to nested subprograms.
* calls.c (expand_call): Prevent sibcall optimization for calls to nested subprograms. From-SVN: r65904
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 9b49f87..06ed14a 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2515,6 +2515,10 @@ expand_call (exp, target, ignore)
optimized. */
|| (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP | ECF_NORETURN))
|| TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr)))
+ /* If the called function is nested in the current one, it might access
+ some of the caller's arguments, but could clobber them beforehand if
+ the argument areas are shared. */
+ || (fndecl && decl_function_context (fndecl) == current_function_decl)
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call. */
|| args_size.constant > current_function_args_size