aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-02-28 22:15:54 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-02-28 22:15:54 +0000
commit7a1ae9237440782d71d44703fe66e234ff6ce432 (patch)
tree97afb37b24ac3411b91e36f06d8734400b26b022
parentcbf6ad9d6119db62e907a7e4a345b3a44137d036 (diff)
downloadgcc-7a1ae9237440782d71d44703fe66e234ff6ce432.zip
gcc-7a1ae9237440782d71d44703fe66e234ff6ce432.tar.gz
gcc-7a1ae9237440782d71d44703fe66e234ff6ce432.tar.bz2
re PR target/79749 (Many sparc testcases FAIL at -O0 with -fomit-frame-pointer)
PR target/79749 * config/sparc/sparc.c (sparc_frame_pointer_required): Add missing condition on optimize for the leaf function test. From-SVN: r245791
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sparc/sparc.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/sparc/20170228-1.c20
4 files changed, 33 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 54021fb..51cb8ab 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index b9213c3..16ca444 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -12180,8 +12180,9 @@ sparc_frame_pointer_required (void)
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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a9ff533..4aab63a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/gcc/testsuite/gcc.target/sparc/20170228-1.c b/gcc/testsuite/gcc.target/sparc/20170228-1.c
new file mode 100644
index 0000000..575fbce
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/20170228-1.c
@@ -0,0 +1,20 @@
+/* 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;
+}