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]

Fix some warnings in libgfortran


I get on Linux/x86-64 these warnings:

./../../libgfortran/generated/matmul_l8.c: In function 'matmul_l8':
../../../libgfortran/generated/matmul_l8.c:93: warning: passing argument 1 of 'size0' from incompatible pointer type
../../../libgfortran/generated/matmul_l8.c:102: warning: 'astride' is used uninitialized in this function
../../../libgfortran/generated/matmul_l8.c:109: warning: 'bstride' is used uninitialized in this function

../../../libgfortran/intrinsics/pack_generic.c: In function 'pack':
../../../libgfortran/intrinsics/pack_generic.c:128: warning: 'mstride0' is used uninitialized in this function

We do set *stride later, the calculation is not needed at all, so I
removed it.

Here's a briefly tested patch.  I'll run a full bootstrap/regression
test on Linux/x86-64 now.  Ok to commit to both mainline and 4.0 if it
passes?

Andreas

2005-05-15  Andreas Jaeger  <aj@suse.de>

	* intrinsics/pack_generic.c (pack): Remove unneeded calculation.

	* m4/matmull.m4 (matmul_): Remove unneeded calculations, fix
	pointer cast to avoid warning.
	* generated/matmul_l4.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.

Index: libgfortran/configure
============================================================
Index: libgfortran/intrinsics/pack_generic.c
--- intrinsics/pack_generic.c	12 Jan 2005 21:27:30 -0000	1.8
+++ intrinsics/pack_generic.c	14 May 2005 22:07:21 -0000
@@ -1,5 +1,5 @@
 /* Generic implementation of the PACK intrinsic
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -125,7 +125,6 @@ pack (gfc_array_char *ret, const gfc_arr
         runtime_error ("Funny sized logical array");
       for (n = 0; n < dim; n++)
         mstride[n] <<= 1;
-      mstride0 <<= 1;
       mptr = GFOR_POINTER_L8_TO_L4 (mptr);
     }
 
============================================================
Index: libgfortran/generated/matmul_l4.c
--- generated/matmul_l4.c	12 Jan 2005 21:27:32 -0000	1.7
+++ generated/matmul_l4.c	14 May 2005 22:07:21 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL 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).
@@ -90,7 +90,7 @@ matmul_l4 (gfc_array_l4 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_LOGICAL_4) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -99,14 +99,12 @@ matmul_l4 (gfc_array_l4 * retarray, gfc_
     {
       assert (GFC_DESCRIPTOR_SIZE (a) == 8);
       abase = GFOR_POINTER_L8_TO_L4 (abase);
-      astride <<= 1;
     }
   bbase = b->data;
   if (GFC_DESCRIPTOR_SIZE (b) != 4)
     {
       assert (GFC_DESCRIPTOR_SIZE (b) == 8);
       bbase = GFOR_POINTER_L8_TO_L4 (bbase);
-      bstride <<= 1;
     }
   dest = retarray->data;
 
============================================================
Index: libgfortran/generated/matmul_l8.c
--- generated/matmul_l8.c	12 Jan 2005 21:27:32 -0000	1.7
+++ generated/matmul_l8.c	14 May 2005 22:07:21 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL 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).
@@ -90,7 +90,7 @@ matmul_l8 (gfc_array_l8 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_LOGICAL_8) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -99,14 +99,12 @@ matmul_l8 (gfc_array_l8 * retarray, gfc_
     {
       assert (GFC_DESCRIPTOR_SIZE (a) == 8);
       abase = GFOR_POINTER_L8_TO_L4 (abase);
-      astride <<= 1;
     }
   bbase = b->data;
   if (GFC_DESCRIPTOR_SIZE (b) != 4)
     {
       assert (GFC_DESCRIPTOR_SIZE (b) == 8);
       bbase = GFOR_POINTER_L8_TO_L4 (bbase);
-      bstride <<= 1;
     }
   dest = retarray->data;

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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