+2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/77439
+ * config/arm/arm.c (arm_function_ok_for_sibcall): Add back restriction
+ for long calls with APCS frame and VFP.
+
2017-01-24 David Malcolm <dmalcolm@redhat.com>
* cfg.c (original_copy_tables_initialized_p): New function.
if (TARGET_VXWORKS_RTP && flag_pic && decl && !targetm.binds_local_p (decl))
return false;
+ /* ??? Cannot tail-call to long calls with APCS frame and VFP, because IP
+ may be used both as target of the call and base register for restoring
+ the VFP registers */
+ if (TARGET_APCS_FRAME && TARGET_ARM
+ && TARGET_HARD_FLOAT
+ && decl && arm_is_long_call_p (decl))
+ return false;
+
/* If we are interworking and the function is not declared static
then we can't tail-call it unless we know that it exists in this
compilation unit (since it might be a Thumb routine). */
+2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/arm/vfp-longcall-apcs.c: New test.
+
2017-01-24 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/rtl/aarch64/asr_div1.c: New test case.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-mapcs-frame -O -foptimize-sibling-calls -ffunction-sections" } */
+
+extern void abort (void);
+
+static __attribute__((noclone, noinline, long_call))
+int foo (int a, int b, int c, int d, double i)
+{
+ return a;
+}
+
+static __attribute__((noclone, noinline))
+double baz (double i)
+{
+ return i;
+}
+
+static __attribute__((noclone, noinline))
+int bar (int a, int b, int c, int d, double i, double j)
+{
+ double l = baz (i) * j;
+ return foo (a, b, c, d, l);
+}
+
+int
+main (void)
+{
+ if (bar (0, 0, 0, 0, 0.0, 0.0) != 0)
+ abort ();
+
+ return 0;
+}