aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-02-05 23:00:29 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-02-05 23:00:29 +0100
commit6fc4ecbc55bbf1995513102bba88a934b51a146b (patch)
treea7a00d3187e66876acc0aa089690b467881ecad7 /gcc
parent0d806438807541d31a759f687279e704ad103609 (diff)
downloadgcc-6fc4ecbc55bbf1995513102bba88a934b51a146b.zip
gcc-6fc4ecbc55bbf1995513102bba88a934b51a146b.tar.gz
gcc-6fc4ecbc55bbf1995513102bba88a934b51a146b.tar.bz2
re PR rtl-optimization/11304 (Wrong code production with -fomit-frame-pointer)
PR rtl-optimization/11304 * gcc.target/i386/call-1.c (set_eax): Add "eax" clobber. * gcc.target/i386/call-2.c: New test. From-SVN: r268562
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/i386/call-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/call-2.c12
3 files changed, 19 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 71ea366..4ae0914 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/11304
+ * gcc.target/i386/call-1.c (set_eax): Add "eax" clobber.
+ * gcc.target/i386/call-2.c: New test.
+
2019-02-05 Marek Polacek <polacek@redhat.com>
PR c++/89158 - by-value capture of constexpr variable broken.
diff --git a/gcc/testsuite/gcc.target/i386/call-1.c b/gcc/testsuite/gcc.target/i386/call-1.c
index bd7c569..a2693a3 100644
--- a/gcc/testsuite/gcc.target/i386/call-1.c
+++ b/gcc/testsuite/gcc.target/i386/call-1.c
@@ -11,7 +11,7 @@ volatile int r;
void set_eax(int val)
{
- __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val));
+ __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val) : "eax");
}
void foo(int val)
diff --git a/gcc/testsuite/gcc.target/i386/call-2.c b/gcc/testsuite/gcc.target/i386/call-2.c
new file mode 100644
index 0000000..0dffcac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/call-2.c
@@ -0,0 +1,12 @@
+/* PR optimization/11304 */
+/* Originator: <manuel.serrano@sophia.inria.fr> */
+/* { dg-do run } */
+/* { dg-options "-O -fomit-frame-pointer" } */
+
+/* Verify that %eax is always restored after a call. */
+
+__attribute__((noipa)) void set_eax(int val);
+__attribute__((noipa)) void foo(int val);
+__attribute__((noipa)) int bar(int x);
+
+#include "call-1.c"