public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8109] x86: Define _serialize as macro
@ 2021-04-10 13:00 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-04-10 13:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:71958f740f1b8c47a86ea222418abee395d254a0

commit r11-8109-g71958f740f1b8c47a86ea222418abee395d254a0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Apr 9 11:44:32 2021 -0700

    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:
---
 gcc/config/i386/serializeintrin.h         |  7 +------
 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 89b5b94ea9b..e280250b198 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 00000000000..9cbefb04536
--- /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 ();
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-10 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10 13:00 [gcc r11-8109] x86: Define _serialize as macro H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).