This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for PR target/38056, IA64 sibcall optimization fix.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 13 Feb 2009 12:43:36 -0800 (PST)
- Subject: Patch for PR target/38056, IA64 sibcall optimization fix.
- Reply-to: sje at cup dot hp dot com
This patch fixes PR target/38056 and allows IA64 to do sibcall
optimizations across object file boundries if -mconstant-gp is used.
Tested on IA64 HP-UX and Linux with no regressions, I will check it in
later today.
Steve Ellcey
sje@cup.hp.com
2009-02-13 Steve Ellcey <sje@cup.hp.com>
PR target/38056
* config/ia64/ia64.c (ia64_function_ok_for_sibcall): Check
TARGET_CONST_GP.
Index: config/ia64/ia64.c
===================================================================
--- config/ia64/ia64.c (revision 144149)
+++ config/ia64/ia64.c (working copy)
@@ -4365,8 +4365,9 @@ ia64_function_ok_for_sibcall (tree decl,
return false;
/* We must always return with our current GP. This means we can
- only sibcall to functions defined in the current module. */
- return decl && (*targetm.binds_local_p) (decl);
+ only sibcall to functions defined in the current module unless
+ TARGET_CONST_GP is set to true. */
+ return (decl && (*targetm.binds_local_p) (decl)) || TARGET_CONST_GP;
}