From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 29966386100B; Wed, 24 Mar 2021 02:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29966386100B From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99744] New: __attribute__ ((target("general-regs-only"))) doesn't work with GPR intrinsics Date: Wed, 24 Mar 2021 02:58:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 02:58:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99744 Bug ID: 99744 Summary: __attribute__ ((target("general-regs-only"))) doesn't work with GPR intrinsics Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: crazylht at gmail dot com, ubizjak at gmail dot com Target Milestone: --- Target: x86-64,i386 [hjl@gnu-cfl-2 uintr-2]$ cat x.c #include extern unsigned long long int curr_deadline; extern void bar (void); __attribute__ ((target("general-regs-only"))) void foo (void) { if (__rdtsc () < curr_deadline) return;=20 bar (); } [hjl@gnu-cfl-2 uintr-2]$ /usr/gcc-11.0.0-x32/bin/gcc -S x.c In file included from /usr/gcc-11.0.0-x32/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/x86gprintrin= .h:27, from /usr/gcc-11.0.0-x32/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/x86intrin.h:= 27, from x.c:1: x.c: In function =E2=80=98foo=E2=80=99: /usr/gcc-11.0.0-x32/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/ia32intrin.h= :112:1: error: inlining failed in call to =E2=80=98always_inline=E2=80=99 =E2=80=98= __rdtsc=E2=80=99: target specific option mismatch 112 | __rdtsc (void) | ^~~~~~~ x.c:10:7: note: called from here 10 | if (__rdtsc () < curr_deadline) | ^~~~~~~~~~ [hjl@gnu-cfl-2 uintr-2]$ ls foo.c Makefile x.c [hjl@gnu-cfl-2 uintr-2]$=20 ix86_can_inline_p failed since caller disabled SSE and MMX, but __rdtsc had SSE and MMX enanbled. However GPR intrinsics don't need SSE nor MMX.=