Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2004 06:16:40 +0000
From:      Dima Dorfman <dd@freebsd.org>
To:        Giorgos Keramidas <keramida@freebsd.org>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code
Message-ID:  <20040913061640.GF42003@trit.org>
In-Reply-To: <200409130600.i8D60msi015043@freefall.freebsd.org>
References:  <200409130600.i8D60msi015043@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Giorgos Keramidas <keramida@freebsd.org> wrote:
>  On 2004-09-13 02:57, Dan Lukes <dan@obluda.cz> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040913061640.GF42003>