From: Uros Bizjak Date: Fri, 10 Jul 2015 15:32:48 +0000 (+0200) Subject: re PR target/66703 ([4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15e3956e406ebeed5e5e9d3f27047e31d4d53411;p=gcc.git re PR target/66703 ([4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586 or on -miamcu) PR target/66703 * gcc.target/i386/readeflags-1.c (readeflags_test): Declare with __attribute__((noinline, noclone)). Change "x" to "volatile char" type to prevent possible flag-clobbering zero-extensions. From-SVN: r225680 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c21e3d83f96..61456046997 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-07-10 Uros Bizjak + + PR target/66703 + * gcc.target/i386/readeflags-1.c (readeflags_test): Declare with + __attribute__((noinline, noclone)). Change "x" to "volatile char" + type to prevent possible flag-clobbering zero-extensions. + 2015-07-10 Paolo Carlini PR c++/60842 diff --git a/gcc/testsuite/gcc.target/i386/readeflags-1.c b/gcc/testsuite/gcc.target/i386/readeflags-1.c index 363a895e704..d0dd0da4555 100644 --- a/gcc/testsuite/gcc.target/i386/readeflags-1.c +++ b/gcc/testsuite/gcc.target/i386/readeflags-1.c @@ -11,10 +11,11 @@ extern void abort (void); #define EFLAGS_TYPE unsigned int #endif -static EFLAGS_TYPE +__attribute__((noinline, noclone)) +EFLAGS_TYPE readeflags_test (unsigned int a, unsigned int b) { - unsigned x = (a == b); + volatile char x = (a == b); return __readeflags (); }