This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fortran] fix -Wuninitialized -Werror in fortran/module.c
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 16 Nov 2009 21:37:08 -0200
- Subject: [fortran] fix -Wuninitialized -Werror in fortran/module.c
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?
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-08 07:31:48.000000000 -0200
+++ gcc/fortran/module.c 2009-11-08 07:32:11.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;
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