Subject: toolchain/22719: gcc3 -march=pentium broken
To: None <gnats-bugs@gnats.netbsd.org>
From: Daniel Carosone <dan@geek.com.au>
List: netbsd-bugs
Date: 09/08/2003 11:20:11
>Number:         22719
>Category:       toolchain
>Synopsis:       gcc3 -march=pentium produces nonworking kernel
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 08 01:21:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Carosone
>Release:        NetBSD 1.6Y
>Organization:
	too little
>Environment:

System: NetBSD bcd.geek.com.au 1.6Y NetBSD 1.6Y (_bcd_) #7: Sun Sep 7 18:22:44 EST 2003 dan@schizo:/home/NetBSD/obj/p2/home/NetBSD/HEAD/src/sys/arch/i386/compile/_bcd_ i386
Architecture: i386
Machine: i386

>Description:

I have built new kernel and userlands for a collection of machines
from the same sources.   For each machine, I used the appropriate
-march=FOO in CPUFLAGS, so I get a kernel that makes use of the
available instructions and is scheduled appropriately for the cpu.

These are all with HAVE_GCC3=yes, and gcc3 introduces the ability
to schedule for something newer than pentiumpro (which is what I
had been using with gcc2).

I have built, and am using successfully, 

 -march=pentium2
 -march=pentium3
 -march=pentium4
 -march=athlon

(this pr is being sent from one such p2 machine)

However, I have an older toshiba libretto notebook, which has only
a pentium:

cpu0: Intel Pentium/MMX (Tillamook) (586-class), 166.65 MHz, id 0x581
cpu0: features 8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
cpu0: features 8001bf<MMX>

When I try to boot its new kernel, built -march=pentium, it reboots
instantly after loading (before Copyright). 

I presume its using an undefined instruction.  I've seen this once
before when I accidentally installed a kernel with the wrong -march
flags, long ago; it's the only machine that can't run a kernel
-march=pentiumpro, all the others are newer.

If I boot the same kernel config, built without any -march= flags
at all, it works fine.

>How-To-Repeat:

Try to squeeze the best use out of old hardware

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