+2017-02-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/79749
+ * config/sparc/sparc.c (sparc_frame_pointer_required): Add missing
+ condition on optimize for the leaf function test.
+
2017-02-28 Martin Liska <mliska@suse.cz>
PR lto/79625
if (TARGET_FLAT)
return false;
- /* Otherwise, the frame pointer is required if the function isn't leaf. */
- return !(crtl->is_leaf && only_leaf_regs_used ());
+ /* Otherwise, the frame pointer is required if the function isn't leaf, but
+ we cannot use sparc_leaf_function_p since it hasn't been computed yet. */
+ return !(optimize > 0 && crtl->is_leaf && only_leaf_regs_used ());
}
/* The way this is structured, we can't eliminate SFP in favor of SP
+2017-02-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/20170228-1.c: New test.
+
2017-02-28 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/invsize-1.c: New test.
--- /dev/null
+/* PR target/79749 */
+/* Reported by Rainer Orth <ro@gcc.gnu.org> */
+
+/* { dg-do run } */
+/* { dg-options "-fomit-frame-pointer" } */
+
+extern void abort (void);
+
+int foo (int x1, int x2, int x3, int x4, int x5, int x6, int x7)
+{
+ return x7;
+}
+
+int main (void)
+{
+ if (foo (100, 200, 300, 400, 500, 600, 700) != 700)
+ abort ();
+
+ return 0;
+}