public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57688] New: -O3 -march=native generates illegal opcode on AMD
Date: Sun, 23 Jun 2013 16:14:00 -0000	[thread overview]
Message-ID: <bug-57688-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57688

            Bug ID: 57688
           Summary: -O3 -march=native generates illegal opcode on AMD
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

Created attachment 30347
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30347&action=edit
C++ source code

I just noticed that -march=native support broke from
date 20130621 to 20130623 for AMD Phenom as follows

[dcb@localhost foundBugs]$ ../results/bin/g++ -g -O3 -Wall bug113.cc
[dcb@localhost foundBugs]$ ./a.out
Time for caxpy1 = 0.16 seconds [5120 Mflops]
[dcb@localhost foundBugs]$ ../results/bin/g++ -g -O3 -march=native -Wall
bug113.cc
[dcb@localhost foundBugs]$ ./a.out
Illegal instruction (core dumped)
[dcb@localhost foundBugs]$

Valgrind helps out with this

vex amd64->IR: unhandled instruction bytes: 0x8F 0xEA 0xF8 0x10 0xD2 0x2 0x1E
0x0
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==23912== valgrind: Unrecognised instruction at address 0x4045e2.
==23912==    at 0x4045E2: caxpy3(Vector<Complex>&, Vector<Complex>&, Complex)
(bug113.cc:52)
==23912==    by 0x4012C0: main (bug113.cc:258)
==23912== Your program just tried to execute an instruction that Valgrind
==23912== did not recognise.  There are two possible reasons for this.
==23912== 1. Your program has a bug and erroneously jumped to a non-code
==23912==    location.  If you are running Memcheck and you just saw a
==23912==    warning about a bad jump, it's probably your program's fault.
==23912== 2. The instruction is legitimate but Valgrind doesn't handle it,
==23912==    i.e. it's Valgrind's fault.  If you think this is the case or
==23912==    you are not sure, please let us know and we'll try to fix it.
==23912== Either way, Valgrind will now raise a SIGILL signal which will
==23912== probably kill your program.
==23912==
==23912== Process terminating with default action of signal 4 (SIGILL)
==23912==  Illegal opcode at address 0x4045E2
==23912==    at 0x4045E2: caxpy3(Vector<Complex>&, Vector<Complex>&, Complex)
(bug113.cc:52)

Also

[dcb@localhost foundBugs]$ head /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 4
model name  : AMD Phenom(tm) II X4 970 Processor
stepping    : 3
microcode   : 0x10000c8
cpu MHz     : 3500.000
cache size  : 512 KB
physical id : 0


             reply	other threads:[~2013-06-23 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 16:14 dcb314 at hotmail dot com [this message]
2013-06-23 16:48 ` [Bug c++/57688] " mikpe at it dot uu.se
2013-06-23 17:23 ` [Bug target/57688] " paolo.carlini at oracle dot com
2013-06-23 18:12 ` jakub at gcc dot gnu.org
2013-06-23 18:41 ` dcb314 at hotmail dot com
2013-06-23 18:44 ` pinskia at gcc dot gnu.org
2013-06-23 18:46 ` dcb314 at hotmail dot com
2013-06-23 18:48 ` dcb314 at hotmail dot com
2013-06-23 18:51 ` [Bug target/57688] -O3 -march=native generates illegal opcode on AMD Phenom dcb314 at hotmail dot com
2013-06-23 19:01 ` mikpe at it dot uu.se

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