public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-99744-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-03-24  2:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  2:58 hjl.tools at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99744-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).