From owner-freebsd-current@FreeBSD.ORG Sun Aug 26 06:52:19 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D1316A41B; Sun, 26 Aug 2007 06:52:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A02C813C45E; Sun, 26 Aug 2007 06:52:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l7Q6pc8t077308; Sun, 26 Aug 2007 00:51:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 26 Aug 2007 00:51:44 -0600 (MDT) Message-Id: <20070826.005144.1120058851.imp@bsdimp.com> To: cnst@freebsd.org From: "M. Warner Losh" In-Reply-To: <46D10B10.2060608@FreeBSD.org> References: <200708260208.35700.h.schmalzbauer@omnisec.de> <200708260216.14210.h.schmalzbauer@omnisec.de> <46D10B10.2060608@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 26 Aug 2007 00:51:42 -0600 (MDT) Cc: kan@freebsd.org, freebsd-current@freebsd.org, h.schmalzbauer@omnisec.de Subject: Re: GSoC2007: cnst-sensors.2007-08-20.patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2007 06:52:19 -0000 In message: <46D10B10.2060608@FreeBSD.org> "Constantine A. Murenin" writes: : On 25/08/2007 20:16, Harald Schmalzbauer wrote: : : >>>http://p4web.freebsd.org/@sr=125633@//depot/projects/soc2007/cnst-sensors/sys.dev.coretemp/coretemp.c : ... : > cc -O2 -fno-strict-aliasing -pipe -march=nocona -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/KORSO/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param : > inline-unit-growth=100 --param : > large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer -I/usr/obj/usr/src/sys/KORSO -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/coretemp/../../dev/coretemp/coretemp.c : > /usr/src/sys/modules/coretemp/../../dev/coretemp/coretemp.c: In : > function 'coretemp_refresh': : > /usr/src/sys/modules/coretemp/../../dev/coretemp/coretemp.c:297: error: SSE : > register return with SSE disabled : > *** Error code 1 : > 1 error : : I cannot reproduce this bug on i386 with gcc 4.2.0 20070514, so this : sounds like a bug in the compiler, either for allowing me to compile the : code that shouldn't compile (and run flawlessly -- coretemp is totally : tested here), or for not allowing you to compile the code that should : compile. (I'll recompile my compiler tomorrow to catch up on the updates : to gcc 4.2.1 to see if that changes anything.) : : Could you please provide more details, e.g. platform (I guess it is : amd64?), compiler version and any changes you've made to the tree? : : : This is the code that seems to generate this error with your compiler: : : s->value = temp * 1e6 + 273.15e6; : : Where s->value is of type int64_t, and temp is of type int. Does anyone : know if the e notation should not be used in this context? It should not. 1e6 is a floating point number, so the result of this operation is a floating point number that's then truncated into an int. It should be computed as a floating point number. Chances are good that the optimizer optimized out all the floating point before, but doesn't now (or does on i386 and not on amd64). On amd64, it appears that this results in attempting to use the SSE stuff, which results in the compiler error. Your solution is correct. Warner