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.
#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__
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mserialize" } */
+
+#include <x86intrin.h>
+
+__attribute__ ((target("general-regs-only")))
+void
+foo1 (void)
+{
+ _serialize ();
+}