comparison libgfortran/generated/minloc0_4_i1.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Implementation of the MINLOC intrinsic 1 /* Implementation of the MINLOC intrinsic
2 Copyright (C) 2002-2018 Free Software Foundation, Inc. 2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
3 Contributed by Paul Brook <paul@nowt.org> 3 Contributed by Paul Brook <paul@nowt.org>
4 4
5 This file is part of the GNU Fortran 95 runtime library (libgfortran). 5 This file is part of the GNU Fortran 95 runtime library (libgfortran).
6 6
7 Libgfortran is free software; you can redistribute it and/or 7 Libgfortran is free software; you can redistribute it and/or
121 if (likely (fast)) 121 if (likely (fast))
122 continue; 122 continue;
123 } 123 }
124 else 124 else
125 #endif 125 #endif
126 if (back) 126 if (back)
127 do 127 do
128 { 128 {
129 if (unlikely (*base <= minval)) 129 if (unlikely (*base <= minval))
130 { 130 {
131 minval = *base; 131 minval = *base;
132 for (n = 0; n < rank; n++) 132 for (n = 0; n < rank; n++)
133 dest[n * dstride] = count[n] + 1; 133 dest[n * dstride] = count[n] + 1;
134 } 134 }
135 base += sstride[0]; 135 base += sstride[0];
136 } 136 }
137 while (++count[0] != extent[0]); 137 while (++count[0] != extent[0]);
138 else 138 else
139 do 139 do
140 { 140 {
141 if (unlikely (*base < minval)) 141 if (unlikely (*base < minval))
142 { 142 {
143 minval = *base; 143 minval = *base;
144 for (n = 0; n < rank; n++) 144 for (n = 0; n < rank; n++)
145 dest[n * dstride] = count[n] + 1; 145 dest[n * dstride] = count[n] + 1;
146 } 146 }
147 /* Implementation end. */ 147 /* Implementation end. */
148 /* Advance to the next element. */ 148 /* Advance to the next element. */
149 base += sstride[0]; 149 base += sstride[0];
150 } 150 }
151 while (++count[0] != extent[0]); 151 while (++count[0] != extent[0]);
196 GFC_LOGICAL_1 *mbase; 196 GFC_LOGICAL_1 *mbase;
197 int rank; 197 int rank;
198 index_type n; 198 index_type n;
199 int mask_kind; 199 int mask_kind;
200 200
201
202 if (mask == NULL)
203 {
204 minloc0_4_i1 (retarray, array, back);
205 return;
206 }
207
201 rank = GFC_DESCRIPTOR_RANK (array); 208 rank = GFC_DESCRIPTOR_RANK (array);
202 if (rank <= 0) 209 if (rank <= 0)
203 runtime_error ("Rank of array needs to be > 0"); 210 runtime_error ("Rank of array needs to be > 0");
204 211
205 if (retarray->base_addr == NULL) 212 if (retarray->base_addr == NULL)
366 index_type rank; 373 index_type rank;
367 index_type dstride; 374 index_type dstride;
368 index_type n; 375 index_type n;
369 GFC_INTEGER_4 *dest; 376 GFC_INTEGER_4 *dest;
370 377
371 if (*mask) 378 if (mask == NULL || *mask)
372 { 379 {
373 minloc0_4_i1 (retarray, array, back); 380 minloc0_4_i1 (retarray, array, back);
374 return; 381 return;
375 } 382 }
376 383