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
+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.
void set_eax(int val)
{
- __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val));
+ __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val) : "eax");
}
void foo(int val)
--- /dev/null
+/* 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"