Mercurial > hg > CbC > CbC_gcc
comparison libgfortran/generated/iany_i4.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Implementation of the IANY intrinsic | 1 /* Implementation of the IANY intrinsic |
2 Copyright (C) 2010-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2010-2018 Free Software Foundation, Inc. |
3 Contributed by Tobias Burnus <burnus@net-b.de> | 3 Contributed by Tobias Burnus <burnus@net-b.de> |
4 | 4 |
5 This file is part of the GNU Fortran runtime library (libgfortran). | 5 This file is part of the GNU Fortran 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 |
98 GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); | 98 GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); |
99 | 99 |
100 } | 100 } |
101 | 101 |
102 retarray->offset = 0; | 102 retarray->offset = 0; |
103 retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; | 103 retarray->dtype.rank = rank; |
104 | 104 |
105 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; | 105 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; |
106 | 106 |
107 retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); | 107 retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); |
108 if (alloc_size == 0) | 108 if (alloc_size == 0) |
148 result = 0; | 148 result = 0; |
149 if (len <= 0) | 149 if (len <= 0) |
150 *dest = 0; | 150 *dest = 0; |
151 else | 151 else |
152 { | 152 { |
153 #if ! defined HAVE_BACK_ARG | |
153 for (n = 0; n < len; n++, src += delta) | 154 for (n = 0; n < len; n++, src += delta) |
154 { | 155 { |
156 #endif | |
155 | 157 |
156 result |= *src; | 158 result |= *src; |
157 } | 159 } |
158 | 160 |
159 *dest = result; | 161 *dest = result; |
285 } | 287 } |
286 | 288 |
287 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; | 289 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; |
288 | 290 |
289 retarray->offset = 0; | 291 retarray->offset = 0; |
290 retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; | 292 retarray->dtype.rank = rank; |
291 | 293 |
292 if (alloc_size == 0) | 294 if (alloc_size == 0) |
293 { | 295 { |
294 /* Make sure we have a zero-sized array. */ | 296 /* Make sure we have a zero-sized array. */ |
295 GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1); | 297 GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1); |
397 index_type dim; | 399 index_type dim; |
398 | 400 |
399 | 401 |
400 if (*mask) | 402 if (*mask) |
401 { | 403 { |
404 #ifdef HAVE_BACK_ARG | |
405 iany_i4 (retarray, array, pdim, back); | |
406 #else | |
402 iany_i4 (retarray, array, pdim); | 407 iany_i4 (retarray, array, pdim); |
408 #endif | |
403 return; | 409 return; |
404 } | 410 } |
405 /* Make dim zero based to avoid confusion. */ | 411 /* Make dim zero based to avoid confusion. */ |
406 dim = (*pdim) - 1; | 412 dim = (*pdim) - 1; |
407 rank = GFC_DESCRIPTOR_RANK (array) - 1; | 413 rank = GFC_DESCRIPTOR_RANK (array) - 1; |
444 GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); | 450 GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); |
445 | 451 |
446 } | 452 } |
447 | 453 |
448 retarray->offset = 0; | 454 retarray->offset = 0; |
449 retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; | 455 retarray->dtype.rank = rank; |
450 | 456 |
451 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; | 457 alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; |
452 | 458 |
453 if (alloc_size == 0) | 459 if (alloc_size == 0) |
454 { | 460 { |