+2003-07-17 Richard Henderson <rth@redhat.com>
+
+ PR target/10907
+ * config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end
+ even with !TARGET_CONST_GP.
+ (ia64_function_ok_for_sibcall): Reject non-local functions.
+
2003-07-17 Steven Bosscher <steven@gcc.gnu.org>
* c-common.c (c_estimate_num_insns_1): Don't handle
tree decl;
tree exp ATTRIBUTE_UNUSED;
{
- /* Direct calls are always ok. */
- if (decl)
- return true;
-
- /* If TARGET_CONST_GP is in effect, then our caller expects us to
- return with our current GP. This means that we'll always have
- a GP reload after an indirect call. */
- return !ia64_epilogue_uses (R_GR (1));
+ /* 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);
}
\f
switch (regno)
{
case R_GR (1):
- /* When a function makes a call through a function descriptor, we
- will write a (potentially) new value to "gp". After returning
- from such a call, we need to make sure the function restores the
- original gp-value, even if the function itself does not use the
- gp anymore. */
- return (TARGET_CONST_GP && !(TARGET_AUTO_PIC || TARGET_NO_PIC));
+ /* With a call to a function in another module, we will write a new
+ value to "gp". After returning from such a call, we need to make
+ sure the function restores the original gp-value, even if the
+ function itself does not use the gp anymore. */
+ return !(TARGET_AUTO_PIC || TARGET_NO_PIC);
case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3):
case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7):