This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran] fix -Wuninitialized -Werror in fortran/module.c
On Nov 16, 2009, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> On Mon, Nov 16, 2009 at 09:37:08PM -0200, Alexandre Oliva wrote:
>> After much inlining and optimization, GCC is not clever enough to
>> realize that variable op is initialized in every path to every use.
>>
>> I ran into this on ia64-linux-gnu, IIRC with bootstrap-O3.
>>
>> Ok to install?
> Yes. Can you add a "/* Silence GCC. */" comment after the
> semicolon to make it clear that the 0 value is never used.
Thanks, here's what I just checked in.
for gcc/fortran/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* module.c (mio_f2k_derived): Initialize op.
Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c.orig 2009-11-18 01:15:44.000000000 -0200
+++ gcc/fortran/module.c 2009-11-18 01:19:17.000000000 -0200
@@ -3469,7 +3469,7 @@ mio_f2k_derived (gfc_namespace *f2k)
else
while (peek_atom () != ATOM_RPAREN)
{
- gfc_intrinsic_op op;
+ gfc_intrinsic_op op = 0; /* Silence GCC. */
mio_lparen ();
mio_intrinsic_op (&op);
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer