mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-23 00:40:59 +08:00
backport: re PR rtl-optimization/11304 (Wrong code production with -fomit-frame-pointer)
Backported from mainline 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. From-SVN: r275102
This commit is contained in:
parent
034762a665
commit
ddb4546b61
@ -3,6 +3,10 @@
|
||||
Backported from mainline
|
||||
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.
|
||||
|
||||
PR target/89188
|
||||
* g++.dg/opt/pr89188.C: New test.
|
||||
|
||||
|
@ -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)
|
||||
|
12
gcc/testsuite/gcc.target/i386/call-2.c
Normal file
12
gcc/testsuite/gcc.target/i386/call-2.c
Normal file
@ -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__((noinline, noclone)) void set_eax(int val);
|
||||
__attribute__((noinline, noclone)) void foo(int val);
|
||||
__attribute__((noinline, noclone)) int bar(int x);
|
||||
|
||||
#include "call-1.c"
|
Loading…
x
Reference in New Issue
Block a user