This is the mail archive of the gcc-patches@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]

[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

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