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: unassig...@gcc.gnu.org
        ReportedBy: gcc.gnu....@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.

Reply via email to