public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/67994] New: __attribute__ ((target("arch=XXX"))) enables unsupported ISA
@ 2015-10-16 18:32 hjl.tools at gmail dot com
  2015-10-17 13:02 ` [Bug target/67994] " hjl.tools at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2015-10-16 18:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67994
           Summary: __attribute__ ((target("arch=XXX"))) enables
                    unsupported ISA
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---

[hjl@gnu-6 pr67985]$ cat r.i
unsigned int
__attribute__ ((target("arch=core2")))
__x86_rdrand(void)
{
  unsigned int retries = 100;
  unsigned int val;

  while (__builtin_ia32_rdrand32_step(&val) == 0)
    if (--retries == 0)
      return 0;

  return val;
}
[hjl@gnu-6 pr67985]$ /export/build/gnu/gcc-test/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-test/build-x86_64-linux/gcc/ -O2 -march=haswell -S -o
r.s r.i
[hjl@gnu-6 pr67985]$ cat r.s
        .file   "r.i"
        .text
        .p2align 4,,15
        .globl  __x86_rdrand
        .type   __x86_rdrand, @function
__x86_rdrand:
.LFB0:
        .cfi_startproc
        movl    $100, %eax
        movl    $1, %ecx
        jmp     .L2
        .p2align 4
.L4:
        subl    $1, %eax
        je      .L8
.L2:
        rdrand  %edx
        movl    %edx, -4(%rsp)
        cmovc   %ecx, %edx
        testl   %edx, %edx
        je      .L4
        movl    -4(%rsp), %eax
.L8:
        ret
        .cfi_endproc
.LFE0:
        .size   __x86_rdrand, .-__x86_rdrand
        .ident  "GCC: (GNU) 6.0.0 20151016 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr67985]$ 

There should be a warning since rdrand isn't supported on Intel Core 2.


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

* [Bug target/67994] __attribute__ ((target("arch=XXX"))) enables unsupported ISA
  2015-10-16 18:32 [Bug target/67994] New: __attribute__ ((target("arch=XXX"))) enables unsupported ISA hjl.tools at gmail dot com
@ 2015-10-17 13:02 ` hjl.tools at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2015-10-17 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
dup

*** This bug has been marked as a duplicate of bug 67995 ***


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

end of thread, other threads:[~2015-10-17 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 18:32 [Bug target/67994] New: __attribute__ ((target("arch=XXX"))) enables unsupported ISA hjl.tools at gmail dot com
2015-10-17 13:02 ` [Bug target/67994] " hjl.tools at gmail 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).