diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-04-09 11:44:32 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-04-10 05:59:09 -0700 |
commit | 71958f740f1b8c47a86ea222418abee395d254a0 (patch) | |
tree | a6cb838e5491cdab5c89b1f3f071214d275047c6 | |
parent | 22aede7a1228617661105048a91fddd8797e141b (diff) | |
download | gcc-71958f740f1b8c47a86ea222418abee395d254a0.zip gcc-71958f740f1b8c47a86ea222418abee395d254a0.tar.gz gcc-71958f740f1b8c47a86ea222418abee395d254a0.tar.bz2 |
x86: Define _serialize as macro
Define _serialize as macro for callers with general-regs-only target
attribute to avoid inline failure with always_inline attribute.
gcc/
PR target/99744
* config/i386/serializeintrin.h (_serialize): Defined as macro.
gcc/testsuite/
PR target/99744
* gcc.target/i386/pr99744-2.c: New test.
-rw-r--r-- | gcc/config/i386/serializeintrin.h | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr99744-2.c | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/config/i386/serializeintrin.h b/gcc/config/i386/serializeintrin.h index 89b5b94..e280250 100644 --- a/gcc/config/i386/serializeintrin.h +++ b/gcc/config/i386/serializeintrin.h @@ -34,12 +34,7 @@ #define __DISABLE_SERIALIZE__ #endif /* __SERIALIZE__ */ -extern __inline void -__attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_serialize (void) -{ - __builtin_ia32_serialize (); -} +#define _serialize() __builtin_ia32_serialize () #ifdef __DISABLE_SERIALIZE__ #undef __DISABLE_SERIALIZE__ diff --git a/gcc/testsuite/gcc.target/i386/pr99744-2.c b/gcc/testsuite/gcc.target/i386/pr99744-2.c new file mode 100644 index 0000000..9cbefb0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99744-2.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mserialize" } */ + +#include <x86intrin.h> + +__attribute__ ((target("general-regs-only"))) +void +foo1 (void) +{ + _serialize (); +} |