This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: '<some_var>' may be used uninitialized in this function
- From: Christian dot Iseli at licr dot org
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Perry Smith <pedz at easesoftware dot net>
- Date: Thu, 12 Jan 2006 17:01:15 +0100
- Subject: Re: warning: '<some_var>' may be used uninitialized in this function
dnovillo@redhat.com said:
> Sub-optimal?
Yes, there is one more instruction to set the variable to 0...
--- testit_1.s 2006-01-12 16:38:06.133760000 +0100
+++ testit.s 2006-01-12 16:57:04.844986000 +0100
@@ -16,6 +16,7 @@
testl %ebx, %ebx
je .L9
movl $0, %edx
+ movl $0, %edi
movl $0, %ecx
.L4:
movl (%esi,%edx,4), %eax
> Neither will the explicit initialization, which I find more readable.
Wrong, see above. Putting "best = best" does not add any instructions.