public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/99744] New: __attribute__ ((target("general-regs-only"))) doesn't work with GPR intrinsics
@ 2021-03-24  2:58 hjl.tools at gmail dot com
  2021-03-24  9:16 ` [Bug target/99744] " rguenth at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: hjl.tools at gmail dot com @ 2021-03-24  2:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99744

            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 <x86intrin.h>

extern unsigned long long int curr_deadline;
extern void bar (void);

__attribute__ ((target("general-regs-only")))
void
foo (void)
{
  if (__rdtsc () < curr_deadline)
    return; 
  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 ‘foo’:
/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 ‘always_inline’ ‘__rdtsc’: 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]$ 

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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-03-15 14:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24  2:58 [Bug target/99744] New: __attribute__ ((target("general-regs-only"))) doesn't work with GPR intrinsics hjl.tools at gmail dot com
2021-03-24  9:16 ` [Bug target/99744] " rguenth at gcc dot gnu.org
2021-03-24  9:47 ` crazylht at gmail dot com
2021-03-24 11:15 ` jakub at gcc dot gnu.org
2021-03-24 17:58 ` hjl.tools at gmail dot com
2021-03-25 12:37 ` cvs-commit at gcc dot gnu.org
2021-03-25 12:43 ` hjl.tools at gmail dot com
2021-03-25 14:00 ` hjl.tools at gmail dot com
2021-03-30 13:29 ` cvs-commit at gcc dot gnu.org
2021-04-10 13:00 ` cvs-commit at gcc dot gnu.org
2021-04-27 11:40 ` jakub at gcc dot gnu.org
2021-07-28  7:06 ` rguenth at gcc dot gnu.org
2021-08-05 13:27 ` cvs-commit at gcc dot gnu.org
2021-08-06  1:45 ` hjl.tools at gmail dot com
2021-08-25 12:58 ` cvs-commit at gcc dot gnu.org
2021-08-25 13:06 ` hjl.tools at gmail dot com
2022-03-15 10:56 ` poulhies at adacore dot com
2022-03-15 14:25 ` hjl.tools at gmail dot com
2022-03-15 14:32 ` poulhies at adacore dot com

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).