* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Return false
if the call takes a static chain.
From-SVN: r264465
+2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Return false
+ if the call takes a static chain.
+
2018-09-19 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.md (atomic_storeqi): Restore deleted expander.
{
tree fntype;
+ /* The sibcall epilogue may clobber the static chain register.
+ ??? We could work harder and avoid that, but it's probably
+ not worth the hassle in practice. */
+ if (CALL_EXPR_STATIC_CHAIN (exp))
+ return false;
+
if (decl)
fntype = TREE_TYPE (decl);
else
+2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/nested-func-11.c: New test.
+
2018-09-13 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+
+int __attribute__((noipa)) foo (int i)
+{
+ int a;
+
+ void __attribute__((noipa)) nested2 (int i)
+ {
+ a = i;
+ }
+
+ void __attribute__((noipa)) nested1 (int i)
+ {
+ int b[32];
+
+ for (int j = 0; j < 32; j++)
+ b[j] = i + j;
+
+ nested2 (b[i]);
+ }
+
+ nested1 (i);
+
+ return a;
+}
+
+int main (void)
+{
+ if (foo (4) != 8)
+ __builtin_abort ();
+
+ return 0;
+}