Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2010 20:12:43 GMT
From:      Alexander <freebsd@nagilum.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   i386/146716: gcc CPU detection error
Message-ID:  <201005182012.o4IKChgw078086@www.freebsd.org>
Resent-Message-ID: <201005182020.o4IKK1vt054802@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         146716
>Category:       i386
>Synopsis:       gcc CPU detection error
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 18 20:20:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Alexander
>Release:        FreeBSD 8.0-STABLE
>Organization:
>Environment:
FreeBSD cakebox.tis 8.0-STABLE FreeBSD 8.0-STABLE #0: Mon Mar  1 12:13:22 CET 2010     root@cakebox.tis:/usr/obj/export/src/sys/net5501  i386
>Description:
This is basically http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37179
$ gcc -march=native -### a16.c
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719  [FreeBSD]
 "/usr/libexec/cc1" "-quiet" "-D_LONGLONG" "a16.c" "-march=athlon" "-mtune=athlon" "-quiet" "-dumpbase" "a16.c" "-auxbase" "a16" "-o" "/var/tmp//cc51kNdo.s"
 "/usr/bin/as" "-o" "/var/tmp//cc6UovRy.o" "/var/tmp//cc51kNdo.s"
 "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "-L/usr/lib" "/var/tmp//cc6UovRy.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"

vs:
$ gcc44 -march=native -### a16.c
Using built-in specs.
Target: i386-portbld-freebsd8.0
Configured with: ./../gcc-4.4-20100427/configure --disable-nls --libdir=/usr/local/lib/gcc44 --libexecdir=/usr/local/libexec/gcc44 --program-suffix=44 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc44/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-system-zlib --disable-rpath --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc44 --build=i386-portbld-freebsd8.0
Thread model: posix
gcc version 4.4.4 20100427 (prerelease) (GCC)
COLLECT_GCC_OPTIONS=
 "/usr/local/libexec/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/cc1" "-quiet" "a16.c" "-march=geode" "--param" "l1-cache-size=64" "--param" "l1-cache-line-size=32" "--param" "l2-cache-size=128" "-mtune=geode" "-quiet" "-dumpbase" "a16.c" "-auxbase" "a16" "-o" "/var/tmp//cct3VB2u.s"
COLLECT_GCC_OPTIONS=
 "/usr/local/bin/as" "-o" "/var/tmp//ccfjzqyD.o" "/var/tmp//cct3VB2u.s"
COMPILER_PATH=/usr/local/libexec/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/:/usr/local/libexec/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/:/usr/local/libexec/gcc44/gcc/i386-portbld-freebsd8.0/:/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/:/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/:/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../../../../i386-portbld-freebsd8.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/:/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../../../../i386-portbld-freebsd8.0/lib/:/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS=
 "/usr/local/libexec/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/collect2" "-dynamic-linker" "/libexec/ld-elf.so.1" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/crtbegin.o" "-L/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4" "-L/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../../../../i386-portbld-freebsd8.0/lib" "-L/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../.." "/var/tmp//ccfjzqyD.o" "-lgcc" "-lgcc_eh" "-lc" "-lgcc" "-lgcc_eh" "/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/crtend.o" "/usr/lib/crtn.o"

nagilum@cakebox /var/run > head -12 dmesg.boot 
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-STABLE #0: Mon Mar  1 12:13:22 CET 2010
    root@cakebox.tis:/usr/obj/export/src/sys/net5501 i386
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Geode(TM) Integrated Processor by AMD PCS (499.90-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x5a2  Stepping = 2
  Features=0x88a93d<FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CLFLUSH,MMX>
  AMD Features=0xc0400000<MMX+,3DNow!+,3DNow!>
real memory  = 536870912 (512 MB)

>How-To-Repeat:
Compile code with -march=native on a Geode system, watch the resulting programs crash and die (no a Geode system).

>Fix:
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37179
As a workaround I'm using "-march=pentium -mtune=generic"

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005182012.o4IKChgw078086>