bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code

Dima Dorfman dd at freebsd.org
Sun Sep 12 23:16:41 PDT 2004


Giorgos Keramidas <keramida at freebsd.org> wrote:
>  On 2004-09-13 02:57, Dan Lukes <dan at 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 at 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.


More information about the freebsd-bugs mailing list