From 7b49b59fb52ea8e809812b003ad6d5d18861f5d4 Mon Sep 17 00:00:00 2001
From: aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 15 May 2005 15:50:09 +0000
Subject: [PATCH] 	* m4/eoshift1.m4: Initialize variables to avoid
 warnings. 	* m4/eoshift3.m4: Initialize variables to avoid warnings. 
 * generated/eoshift1_4.c, generated/eoshift1_8.c, 
 generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerated.

	* intrinsics/spread_generic.c (spread): Initialize variables to
	avoid warnings.

	* intrinsics/eoshift0.c (eoshift0): Initialize variables to avoid
	warnings.
	* intrinsics/eoshift2.c (eoshift2): Initialize variables to avoid
	warnings.

	* io/list_read.c (nml_get_obj_data): Initialize variables to avoid
	warnings.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99726 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgfortran/ChangeLog                   | 16 ++++++++++++++++
 libgfortran/generated/eoshift1_4.c      |  8 +++++++-
 libgfortran/generated/eoshift1_8.c      |  8 +++++++-
 libgfortran/generated/eoshift3_4.c      |  8 +++++++-
 libgfortran/generated/eoshift3_8.c      |  8 +++++++-
 libgfortran/intrinsics/eoshift0.c       |  9 +++++++--
 libgfortran/intrinsics/eoshift2.c       |  9 +++++++--
 libgfortran/intrinsics/spread_generic.c |  4 ++--
 libgfortran/io/list_read.c              |  4 ++--
 libgfortran/m4/eoshift1.m4              |  8 +++++++-
 libgfortran/m4/eoshift3.m4              |  8 +++++++-
 11 files changed, 76 insertions(+), 14 deletions(-)

diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 18d1edfac4b1..609c4f403f56 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,21 @@
 2005-05-15  Andreas Jaeger  <aj@suse.de>
 
+	* m4/eoshift1.m4: Initialize variables to avoid warnings.
+	* m4/eoshift3.m4: Initialize variables to avoid warnings.
+	* generated/eoshift1_4.c, generated/eoshift1_8.c,
+	generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerated.
+
+	* intrinsics/spread_generic.c (spread): Initialize variables to
+	avoid warnings.
+
+	* intrinsics/eoshift0.c (eoshift0): Initialize variables to avoid
+	warnings.
+	* intrinsics/eoshift2.c (eoshift2): Initialize variables to avoid
+	warnings.
+
+	* io/list_read.c (nml_get_obj_data): Initialize variables to avoid
+	warnings.
+
 	* intrinsics/pack_generic.c (pack): Remove unneeded calculation.
 
 	* m4/matmull.m4 (matmul_): Remove unneeded calculations, fix
diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c
index 6c2ad301728f..3503f825c6a7 100644
--- a/libgfortran/generated/eoshift1_4.c
+++ b/libgfortran/generated/eoshift1_4.c
@@ -1,5 +1,5 @@
 /* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -76,6 +76,12 @@ eoshift1_4 (const gfc_array_char *ret,
   GFC_INTEGER_4 sh;
   GFC_INTEGER_4 delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c
index c1d99c3de154..bfa608814ff9 100644
--- a/libgfortran/generated/eoshift1_8.c
+++ b/libgfortran/generated/eoshift1_8.c
@@ -1,5 +1,5 @@
 /* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -76,6 +76,12 @@ eoshift1_8 (const gfc_array_char *ret,
   GFC_INTEGER_8 sh;
   GFC_INTEGER_8 delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c
index 088cfbeba498..964d98b55ed3 100644
--- a/libgfortran/generated/eoshift3_4.c
+++ b/libgfortran/generated/eoshift3_4.c
@@ -1,5 +1,5 @@
 /* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -78,6 +78,12 @@ eoshift3_4 (gfc_array_char *ret, gfc_array_char *array,
   GFC_INTEGER_4 sh;
   GFC_INTEGER_4 delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c
index 302b159c0c85..c17b5885e280 100644
--- a/libgfortran/generated/eoshift3_8.c
+++ b/libgfortran/generated/eoshift3_8.c
@@ -1,5 +1,5 @@
 /* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -78,6 +78,12 @@ eoshift3_8 (gfc_array_char *ret, gfc_array_char *array,
   GFC_INTEGER_8 sh;
   GFC_INTEGER_8 delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c
index 5db3737c3556..b1fbd1a516ad 100644
--- a/libgfortran/intrinsics/eoshift0.c
+++ b/libgfortran/intrinsics/eoshift0.c
@@ -1,5 +1,5 @@
 /* Generic implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -64,6 +64,12 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array,
   index_type len;
   index_type n;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (!pbound)
     pbound = zeros;
 
@@ -251,4 +257,3 @@ eoshift0_8 (gfc_array_char *ret, const gfc_array_char *array,
 {
   eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1);
 }
-
diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c
index 8d22dbef7428..70baf3c18d15 100644
--- a/libgfortran/intrinsics/eoshift2.c
+++ b/libgfortran/intrinsics/eoshift2.c
@@ -1,5 +1,5 @@
 /* Generic implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -68,6 +68,12 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
   index_type len;
   index_type n;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   size = GFC_DESCRIPTOR_SIZE (ret);
 
   if (ret->data == NULL)
@@ -267,4 +273,3 @@ eoshift2_8 (gfc_array_char *ret, const gfc_array_char *array,
 {
   eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1);
 }
-
diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c
index 8d39d30d318b..01152870688b 100644
--- a/libgfortran/intrinsics/spread_generic.c
+++ b/libgfortran/intrinsics/spread_generic.c
@@ -1,5 +1,5 @@
 /* Generic implementation of the SPREAD intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -45,7 +45,7 @@ spread (gfc_array_char *ret, const gfc_array_char *source,
   /* r.* indicates the return array.  */
   index_type rstride[GFC_MAX_DIMENSIONS];
   index_type rstride0;
-  index_type rdelta;
+  index_type rdelta = 0;
   index_type rrank;
   index_type rs;
   char *rptr;
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b6721557c6ea..fb61890a64a1 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2026,8 +2026,8 @@ nml_get_obj_data (void)
   char c;
   char * ext_name;
   namelist_info * nl;
-  namelist_info * first_nl;
-  namelist_info * root_nl;
+  namelist_info * first_nl = NULL;
+  namelist_info * root_nl = NULL;
   int dim;
   int component_flag;
 
diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4
index 9cf6fa9a84a3..b21c6d347323 100644
--- a/libgfortran/m4/eoshift1.m4
+++ b/libgfortran/m4/eoshift1.m4
@@ -1,5 +1,5 @@
 `/* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -77,6 +77,12 @@ eoshift1_`'atype_kind (const gfc_array_char *ret,
   atype_name sh;
   atype_name delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4
index 89dcb3fcff8e..6cbb87cfb844 100644
--- a/libgfortran/m4/eoshift3.m4
+++ b/libgfortran/m4/eoshift3.m4
@@ -1,5 +1,5 @@
 `/* Implementation of the EOSHIFT intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -79,6 +79,12 @@ eoshift3_`'atype_kind (gfc_array_char *ret, gfc_array_char *array,
   atype_name sh;
   atype_name delta;
 
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
   if (pwhich)
     which = *pwhich - 1;
   else
-- 
GitLab