+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.
+
2009-02-13 H.J. Lu <hongjiu.lu@intel.com>
PR target/39149
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;
}
\f
+2009-02-13 Steve Ellcey <sje@cup.hp.com>
+
+ PR target/38056
+ * gcc.target/ia64/sibcall-opt-1.c: New test.
+ * gcc.target/ia64/sibcall-opt-2.c: New test.
+
2009-02-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/36528
--- /dev/null
+/* PR target/38056. Do not do sibcall optimization across object file
+ boundery when -mconstant-gp is not used. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "br.call.*bar" } } */
+
+int bar(int x);
+
+int foo(int x)
+{
+ return (bar(x + 1));
+}
--- /dev/null
+/* PR target/38056. Do sibcall optimization across object file
+ boundery when -mconstant-gp is used. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mconstant-gp" } */
+/* { dg-final { scan-assembler-not "br.call.*bar" } } */
+
+int bar(int x);
+
+int foo(int x)
+{
+ return (bar(x + 1));
+}