From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 98A86385700A; Sat, 10 Apr 2021 13:00:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98A86385700A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: H.J. Lu To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8109] x86: Define _serialize as macro X-Act-Checkin: gcc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: 22aede7a1228617661105048a91fddd8797e141b X-Git-Newrev: 71958f740f1b8c47a86ea222418abee395d254a0 Message-Id: <20210410130024.98A86385700A@sourceware.org> Date: Sat, 10 Apr 2021 13:00:24 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2021 13:00:24 -0000 https://gcc.gnu.org/g:71958f740f1b8c47a86ea222418abee395d254a0 commit r11-8109-g71958f740f1b8c47a86ea222418abee395d254a0 Author: H.J. Lu 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 + +__attribute__ ((target("general-regs-only"))) +void +foo1 (void) +{ + _serialize (); +}