From: H.J. Lu Date: Fri, 9 Apr 2021 18:44:32 +0000 (-0700) Subject: x86: Define _serialize as macro X-Git-Tag: basepoints/gcc-12~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71958f740f1;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/i386/serializeintrin.h b/gcc/config/i386/serializeintrin.h index 89b5b94ea9bd..e280250b1983 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 000000000000..9cbefb04536d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99744-2.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mserialize" } */ + +#include + +__attribute__ ((target("general-regs-only"))) +void +foo1 (void) +{ + _serialize (); +}