From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 13 06:16:41 2004 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38EF716A4CF; Mon, 13 Sep 2004 06:16:41 +0000 (GMT) Received: from beaver.trit.org (beaver.trit.org [69.107.245.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B72943D39; Mon, 13 Sep 2004 06:16:41 +0000 (GMT) (envelope-from dd@freebsd.org) Received: by beaver.trit.org (Postfix, from userid 1000) id BEB7A90DCB1; Mon, 13 Sep 2004 06:16:40 +0000 (UTC) Date: Mon, 13 Sep 2004 06:16:40 +0000 From: Dima Dorfman To: Giorgos Keramidas Message-ID: <20040913061640.GF42003@trit.org> References: <200409130600.i8D60msi015043@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200409130600.i8D60msi015043@freefall.freebsd.org> User-Agent: Mutt/1.4.2.1i X-PGP-Key: 69FAE582 (http://www.trit.org/~dima/dima.asc) X-PGP-Fingerprint: B340 8338 7DA3 4D61 7632 098E 0730 055B 69FA E582 cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 06:16:41 -0000 Giorgos Keramidas wrote: > On 2004-09-13 02:57, Dan Lukes wrote: > > The unnecesarry initialisation of variable initialised again later > > seems to be vaste of resources. But IMHO only. > > This initialization > > char *foo = foo; > > is not cheaper than this one: > > char *foo = NULL; To be fair, it could be cheaper because gcc optimizes out the assignment: dima@beaver% diff -u init-null.s init-self.s --- init-null.s Mon Sep 13 06:12:05 2004 +++ init-self.s Mon Sep 13 06:12:02 2004 @@ -14,7 +14,6 @@ shrl $4, %eax sall $4, %eax subl %eax, %esp - movl $0, -4(%ebp) movl $0, %eax leave ret It is likely that I spent more time writing this email than would be spent executing such an extra instruction in its lifetime.