OSDN Git Service

2006-03-13 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / minloc0_4_r4.c
index 0c93800..f55bbae 100644 (file)
@@ -106,7 +106,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   /* Initialize the return value.  */
   for (n = 0; n < rank; n++)
-    dest[n * dstride] = 1;
+    dest[n * dstride] = 0;
   {
 
   GFC_REAL_4 minval;
@@ -118,7 +118,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
       {
         /* Implementation start.  */
 
-  if (*base < minval)
+  if (*base < minval || !dest[0])
     {
       minval = *base;
       for (n = 0; n < rank; n++)
@@ -241,7 +241,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   /* Initialize the return value.  */
   for (n = 0; n < rank; n++)
-    dest[n * dstride] = 1;
+    dest[n * dstride] = 0;
   {
 
   GFC_REAL_4 minval;
@@ -253,7 +253,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
       {
         /* Implementation start.  */
 
-  if (*mbase && *base < minval)
+  if (*mbase && (*base < minval || !dest[0]))
     {
       minval = *base;
       for (n = 0; n < rank; n++)