This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]