From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 10:54:23 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0EA106564A; Sat, 4 Dec 2010 10:54:23 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id C70A38FC16; Sat, 4 Dec 2010 10:54:22 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0FB889CB0DD; Sat, 4 Dec 2010 11:36:26 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k0WBsZg79DAG; Sat, 4 Dec 2010 11:36:25 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 660949CB14A; Sat, 4 Dec 2010 11:36:25 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id oB4AaPHK002206; Sat, 4 Dec 2010 11:36:25 +0100 (CET) (envelope-from rdivacky) Date: Sat, 4 Dec 2010 11:36:25 +0100 From: Roman Divacky To: Jung-uk Kim Message-ID: <20101204103625.GA106@freebsd.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012031817.23834.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 10:54:23 -0000 On Fri, Dec 03, 2010 at 06:17:16PM -0500, Jung-uk Kim wrote: > On Friday 03 December 2010 06:02 pm, Jung-uk Kim wrote: > > On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: > > > On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > > > > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > > > > Author: jkim > > > > > Date: Fri Dec 3 21:54:10 2010 > > > > > New Revision: 216161 > > > > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > > > > > > > Log: > > > > > Explicitly initialize TSC frequency. To calibrate TSC > > > > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > > > > frequency is non-zero. > > > > > > > > We zero the BSS, so these were already zero. This just makes > > > > the actual kernel file on disk larger by wasting space in .data > > > > instead of .bss. > > > > > > Please note that I didn't touch other variables, e.g., > > > tsc_is_broken, because I knew that. However, I just wanted to do > > > that *explicitly*. Anyway, it is reverted now and SVN will > > > remember what I wanted to do. ;-) > > > > > > BTW, if my memory serves, GCC (and all modern C compilers) put(s) > > > zero-initialized variables back in .bss. > > > > I just tried it. GCC generates identical binaries as I thought. > > However, Clang doesn't do the optimization. :-/ > > Strangely, Clang increases .bss when a global variable is explicitly > initialized to zero. > > - 2 .bss 00000004 0000000000000000 0000000000000000 00000540 2**2 > + 2 .bss 00000014 0000000000000000 0000000000000000 00000540 2**3 in my naive test gcc produces: .globl foo .section .bss .align 4 .type foo, @object .size foo, 4 foo: .zero 4 and clang produces: .type foo,@object # @foo .bss .globl foo .align 4 foo: .long 0 # 0x0 .size foo, 4 ie. both put them into BSS