From root@data.freefilm.za.org Thu Sep 23 04:16:55 1999
Return-Path: <root@data.freefilm.za.org>
Received: from data.freefilm.za.org (data.mandrakesoft.de [151.189.96.133])
	by hub.freebsd.org (Postfix) with ESMTP id 54CC114EC2
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 23 Sep 1999 04:16:51 -0700 (PDT)
	(envelope-from root@data.freefilm.za.org)
Received: (from root@localhost)
	by data.freefilm.za.org (8.9.3/8.9.3) id NAA01322;
	Thu, 23 Sep 1999 13:10:48 +0200 (CEST)
	(envelope-from root)
Message-Id: <199909231110.NAA01322@data.freefilm.za.org>
Date: Thu, 23 Sep 1999 13:10:48 +0200 (CEST)
From: bero@ms-windows-2000.com
Sender: root@data.freefilm.za.org
Reply-To: bero@ms-windows-2000.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: 3.3-RELEASE kernel / gcc 2.95.1
X-Send-Pr-Version: 3.2

>Number:         13917
>Category:       kern
>Synopsis:       Kernel doesn't work with gcc 2.95.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 23 04:20:01 PDT 1999
>Closed-Date:    Thu Sep 23 12:59:07 PDT 1999
>Last-Modified:  Thu Sep 23 13:00:16 PDT 1999
>Originator:     Bernhard Rosenkraenzer
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
MandrakeSoft
>Environment:

FreeBSD 3.3-RELEASE, ix86, gcc 2.95.1

>Description:

Just tried building the kernel with gcc 2.95.1 for performance reasons
(-mcpu=k6 -march=k6...).
First of all, it doesn't compile because of a broken asm() construct in
i386/include/bus.h, line 575: The esi and ecx are listed as clobbered despite
being used for return values [and therefore being clobbered implicitly].
[Patch in Fix:]

Also, I had to remove the -fformat-extensions CFLAG from bsd.kern.mk because
it's obsolete.

After fixing this, the kernel compiles; but trying to boot it immediately
reboots the machine.
The last line output by the kernel before rebooting is

real memory  = 83886080 (81920K bytes)

Is there a known fix for compiling with gcc 2.95.1 yet? Any ideas where to
start debugging the problem?

>How-To-Repeat:

Attempt to compile the kernel with gcc 2.95.1; used CFLAGS:
-O2 -fno-strict-aliasing -mcpu=k6 -march=k6 -pipe -fno-exceptions

>Fix:
	
--- sys/i386/include/bus.h.broken	Sun Aug 29 18:06:21 1999
+++ sys/i386/include/bus.h	Thu Sep 23 12:13:13 1999
@@ -571,8 +571,7 @@
 			movb %%al,(%1)				\n\
 			loop 1b"				:
 		    "=&a" (__x)					:
-		    "r" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%esi", "%ecx");
+		    "r" (bsh + offset), "S" (addr), "c" (count));
 	}
 #endif
 }


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed  
State-Changed-By: cpiazza 
State-Changed-When: Thu Sep 23 12:59:07 PDT 1999 
State-Changed-Why:  
Compiling the kernel with gcc 2.95.1 is not a supported configuration 
on -stable or -current at this time.  Feel free to make any local changes, 
of course. 
>Unformatted:
