public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/48743] New: -march=native mis-detects AMD K6-2+ / K6-3 as Athlon - compiled C fails with "illegal instruction"
@ 2011-04-23 21:09 gcc.gnu.org at stellar dot eclipse.co.uk
  2011-04-23 21:12 ` [Bug target/48743] " gcc.gnu.org at stellar dot eclipse.co.uk
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc.gnu.org at stellar dot eclipse.co.uk @ 2011-04-23 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: -march=native mis-detects AMD K6-2+ / K6-3 as Athlon -
                    compiled C fails with "illegal instruction"
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gcc.gnu.org@stellar.eclipse.co.uk


Created attachment 24084
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24084
Output of  `echo | gcc -dM -E - -march=native`

When I compile nano on my Linux system using `-march=i586`, `-march=k6-2` or
`-march=k6-3` it works fine.
If I compile it with `-march=native` then nano crashes on startup saying
"illegal instruction".


/proc/cpuinfo seems to show the CPU correctly:

# cat /proc/cpuinfo 
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 13
model name      : AMD-K6(tm)-III Processor
stepping        : 4
cpu MHz         : 448.140
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr cx8 pge mmx syscall 3dnowext 3dnow
k6_mtrr
bogomips        : 896.28
clflush size    : 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
power management: ts fid vid

However gcc seems to misdetect it:

# gcc -v -Q --help=target -march=native 2>&1 | grep march
/usr/libexec/gcc/i586-pc-linux-gnu/4.5.2/cc1 -v help-dummy -D_FORTIFY_SOURCE=2
-march=athlon --param l1-cache-size=32 --param l1-cache-line-size=32 --param
l2-cache-size=128 -mtune=athlon -dumpbase help-dummy -auxbase help-dummy
-version -fhelp=target -o /tmp/ccQrke9q.s
 -march=                               athlon
# cc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/i586-pc-linux-gnu/4.5.2/cc1 -E -quiet -v -
-D_FORTIFY_SOURCE=2 -march=athlon --param l1-cache-size=32 --param
l1-cache-line-size=32 --param l2-cache-size=128 -mtune=athlon

Output of  `echo | gcc -dM -E - -march=native` attached.


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

end of thread, other threads:[~2012-02-08 10:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-23 21:09 [Bug target/48743] New: -march=native mis-detects AMD K6-2+ / K6-3 as Athlon - compiled C fails with "illegal instruction" gcc.gnu.org at stellar dot eclipse.co.uk
2011-04-23 21:12 ` [Bug target/48743] " gcc.gnu.org at stellar dot eclipse.co.uk
2011-04-23 21:14 ` gcc.gnu.org at stellar dot eclipse.co.uk
2011-05-12  8:59 ` zuxy.meng at gmail dot com
2011-05-22 14:46 ` mikpe at it dot uu.se
2011-06-16 15:10 ` gcc.gnu.org at stellar dot eclipse.co.uk
2011-12-19 18:03 ` qneill at gcc dot gnu.org
2011-12-19 18:57 ` qneill at gcc dot gnu.org
2012-01-19 20:23 ` qneill at gcc dot gnu.org
2012-02-07 16:18 ` qneill at gcc dot gnu.org
2012-02-08 10:45 ` rguenth at gcc dot gnu.org

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