summaryrefslogtreecommitdiff
path: root/libgfortran/generated
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-17 19:31:06 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-17 19:31:06 +0000
commit8e882a1674e70cdea3bf8630a7613fe2bf12e52d (patch)
tree3580b7403687d7d146efbcceecee9d57deff3d8f /libgfortran/generated
parentfade5ce98b583fa416ba84b4cc3cad12af227f57 (diff)
parent634a5ad7fc8a4498978609c4e523b29658affa22 (diff)
downloadgcc-8e882a1674e70cdea3bf8630a7613fe2bf12e52d.tar.gz
2014-06-17 Tobias Burnus <burnus@net-b.de>
* Merge from the trunk to r211744. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@211745 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated')
-rw-r--r--libgfortran/generated/all_l1.c5
-rw-r--r--libgfortran/generated/all_l16.c5
-rw-r--r--libgfortran/generated/all_l2.c5
-rw-r--r--libgfortran/generated/all_l4.c5
-rw-r--r--libgfortran/generated/all_l8.c5
-rw-r--r--libgfortran/generated/any_l1.c5
-rw-r--r--libgfortran/generated/any_l16.c5
-rw-r--r--libgfortran/generated/any_l2.c5
-rw-r--r--libgfortran/generated/any_l4.c5
-rw-r--r--libgfortran/generated/any_l8.c5
-rw-r--r--libgfortran/generated/bessel_r10.c4
-rw-r--r--libgfortran/generated/bessel_r16.c4
-rw-r--r--libgfortran/generated/bessel_r4.c4
-rw-r--r--libgfortran/generated/bessel_r8.c4
-rw-r--r--libgfortran/generated/count_16_l.c5
-rw-r--r--libgfortran/generated/count_1_l.c5
-rw-r--r--libgfortran/generated/count_2_l.c5
-rw-r--r--libgfortran/generated/count_4_l.c5
-rw-r--r--libgfortran/generated/count_8_l.c5
-rw-r--r--libgfortran/generated/cshift1_16.c2
-rw-r--r--libgfortran/generated/cshift1_4.c2
-rw-r--r--libgfortran/generated/cshift1_8.c2
-rw-r--r--libgfortran/generated/eoshift1_16.c4
-rw-r--r--libgfortran/generated/eoshift1_4.c4
-rw-r--r--libgfortran/generated/eoshift1_8.c4
-rw-r--r--libgfortran/generated/eoshift3_16.c6
-rw-r--r--libgfortran/generated/eoshift3_4.c6
-rw-r--r--libgfortran/generated/eoshift3_8.c6
-rw-r--r--libgfortran/generated/iall_i1.c15
-rw-r--r--libgfortran/generated/iall_i16.c15
-rw-r--r--libgfortran/generated/iall_i2.c15
-rw-r--r--libgfortran/generated/iall_i4.c15
-rw-r--r--libgfortran/generated/iall_i8.c15
-rw-r--r--libgfortran/generated/iany_i1.c15
-rw-r--r--libgfortran/generated/iany_i16.c15
-rw-r--r--libgfortran/generated/iany_i2.c15
-rw-r--r--libgfortran/generated/iany_i4.c15
-rw-r--r--libgfortran/generated/iany_i8.c15
-rw-r--r--libgfortran/generated/in_pack_c10.c2
-rw-r--r--libgfortran/generated/in_pack_c16.c2
-rw-r--r--libgfortran/generated/in_pack_c4.c2
-rw-r--r--libgfortran/generated/in_pack_c8.c2
-rw-r--r--libgfortran/generated/in_pack_i1.c2
-rw-r--r--libgfortran/generated/in_pack_i16.c2
-rw-r--r--libgfortran/generated/in_pack_i2.c2
-rw-r--r--libgfortran/generated/in_pack_i4.c2
-rw-r--r--libgfortran/generated/in_pack_i8.c2
-rw-r--r--libgfortran/generated/in_pack_r10.c2
-rw-r--r--libgfortran/generated/in_pack_r16.c2
-rw-r--r--libgfortran/generated/in_pack_r4.c2
-rw-r--r--libgfortran/generated/in_pack_r8.c2
-rw-r--r--libgfortran/generated/iparity_i1.c15
-rw-r--r--libgfortran/generated/iparity_i16.c15
-rw-r--r--libgfortran/generated/iparity_i2.c15
-rw-r--r--libgfortran/generated/iparity_i4.c15
-rw-r--r--libgfortran/generated/iparity_i8.c15
-rw-r--r--libgfortran/generated/matmul_c10.c2
-rw-r--r--libgfortran/generated/matmul_c16.c2
-rw-r--r--libgfortran/generated/matmul_c4.c2
-rw-r--r--libgfortran/generated/matmul_c8.c2
-rw-r--r--libgfortran/generated/matmul_i1.c2
-rw-r--r--libgfortran/generated/matmul_i16.c2
-rw-r--r--libgfortran/generated/matmul_i2.c2
-rw-r--r--libgfortran/generated/matmul_i4.c2
-rw-r--r--libgfortran/generated/matmul_i8.c2
-rw-r--r--libgfortran/generated/matmul_l16.c2
-rw-r--r--libgfortran/generated/matmul_l4.c2
-rw-r--r--libgfortran/generated/matmul_l8.c2
-rw-r--r--libgfortran/generated/matmul_r10.c2
-rw-r--r--libgfortran/generated/matmul_r16.c2
-rw-r--r--libgfortran/generated/matmul_r4.c2
-rw-r--r--libgfortran/generated/matmul_r8.c2
-rw-r--r--libgfortran/generated/maxloc0_16_i1.c6
-rw-r--r--libgfortran/generated/maxloc0_16_i16.c6
-rw-r--r--libgfortran/generated/maxloc0_16_i2.c6
-rw-r--r--libgfortran/generated/maxloc0_16_i4.c6
-rw-r--r--libgfortran/generated/maxloc0_16_i8.c6
-rw-r--r--libgfortran/generated/maxloc0_16_r10.c6
-rw-r--r--libgfortran/generated/maxloc0_16_r16.c6
-rw-r--r--libgfortran/generated/maxloc0_16_r4.c6
-rw-r--r--libgfortran/generated/maxloc0_16_r8.c6
-rw-r--r--libgfortran/generated/maxloc0_4_i1.c6
-rw-r--r--libgfortran/generated/maxloc0_4_i16.c6
-rw-r--r--libgfortran/generated/maxloc0_4_i2.c6
-rw-r--r--libgfortran/generated/maxloc0_4_i4.c6
-rw-r--r--libgfortran/generated/maxloc0_4_i8.c6
-rw-r--r--libgfortran/generated/maxloc0_4_r10.c6
-rw-r--r--libgfortran/generated/maxloc0_4_r16.c6
-rw-r--r--libgfortran/generated/maxloc0_4_r4.c6
-rw-r--r--libgfortran/generated/maxloc0_4_r8.c6
-rw-r--r--libgfortran/generated/maxloc0_8_i1.c6
-rw-r--r--libgfortran/generated/maxloc0_8_i16.c6
-rw-r--r--libgfortran/generated/maxloc0_8_i2.c6
-rw-r--r--libgfortran/generated/maxloc0_8_i4.c6
-rw-r--r--libgfortran/generated/maxloc0_8_i8.c6
-rw-r--r--libgfortran/generated/maxloc0_8_r10.c6
-rw-r--r--libgfortran/generated/maxloc0_8_r16.c6
-rw-r--r--libgfortran/generated/maxloc0_8_r4.c6
-rw-r--r--libgfortran/generated/maxloc0_8_r8.c6
-rw-r--r--libgfortran/generated/maxloc1_16_i1.c15
-rw-r--r--libgfortran/generated/maxloc1_16_i16.c15
-rw-r--r--libgfortran/generated/maxloc1_16_i2.c15
-rw-r--r--libgfortran/generated/maxloc1_16_i4.c15
-rw-r--r--libgfortran/generated/maxloc1_16_i8.c15
-rw-r--r--libgfortran/generated/maxloc1_16_r10.c15
-rw-r--r--libgfortran/generated/maxloc1_16_r16.c15
-rw-r--r--libgfortran/generated/maxloc1_16_r4.c15
-rw-r--r--libgfortran/generated/maxloc1_16_r8.c15
-rw-r--r--libgfortran/generated/maxloc1_4_i1.c15
-rw-r--r--libgfortran/generated/maxloc1_4_i16.c15
-rw-r--r--libgfortran/generated/maxloc1_4_i2.c15
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c15
-rw-r--r--libgfortran/generated/maxloc1_4_i8.c15
-rw-r--r--libgfortran/generated/maxloc1_4_r10.c15
-rw-r--r--libgfortran/generated/maxloc1_4_r16.c15
-rw-r--r--libgfortran/generated/maxloc1_4_r4.c15
-rw-r--r--libgfortran/generated/maxloc1_4_r8.c15
-rw-r--r--libgfortran/generated/maxloc1_8_i1.c15
-rw-r--r--libgfortran/generated/maxloc1_8_i16.c15
-rw-r--r--libgfortran/generated/maxloc1_8_i2.c15
-rw-r--r--libgfortran/generated/maxloc1_8_i4.c15
-rw-r--r--libgfortran/generated/maxloc1_8_i8.c15
-rw-r--r--libgfortran/generated/maxloc1_8_r10.c15
-rw-r--r--libgfortran/generated/maxloc1_8_r16.c15
-rw-r--r--libgfortran/generated/maxloc1_8_r4.c15
-rw-r--r--libgfortran/generated/maxloc1_8_r8.c15
-rw-r--r--libgfortran/generated/maxval_i1.c15
-rw-r--r--libgfortran/generated/maxval_i16.c15
-rw-r--r--libgfortran/generated/maxval_i2.c15
-rw-r--r--libgfortran/generated/maxval_i4.c15
-rw-r--r--libgfortran/generated/maxval_i8.c15
-rw-r--r--libgfortran/generated/maxval_r10.c15
-rw-r--r--libgfortran/generated/maxval_r16.c15
-rw-r--r--libgfortran/generated/maxval_r4.c15
-rw-r--r--libgfortran/generated/maxval_r8.c15
-rw-r--r--libgfortran/generated/minloc0_16_i1.c6
-rw-r--r--libgfortran/generated/minloc0_16_i16.c6
-rw-r--r--libgfortran/generated/minloc0_16_i2.c6
-rw-r--r--libgfortran/generated/minloc0_16_i4.c6
-rw-r--r--libgfortran/generated/minloc0_16_i8.c6
-rw-r--r--libgfortran/generated/minloc0_16_r10.c6
-rw-r--r--libgfortran/generated/minloc0_16_r16.c6
-rw-r--r--libgfortran/generated/minloc0_16_r4.c6
-rw-r--r--libgfortran/generated/minloc0_16_r8.c6
-rw-r--r--libgfortran/generated/minloc0_4_i1.c6
-rw-r--r--libgfortran/generated/minloc0_4_i16.c6
-rw-r--r--libgfortran/generated/minloc0_4_i2.c6
-rw-r--r--libgfortran/generated/minloc0_4_i4.c6
-rw-r--r--libgfortran/generated/minloc0_4_i8.c6
-rw-r--r--libgfortran/generated/minloc0_4_r10.c6
-rw-r--r--libgfortran/generated/minloc0_4_r16.c6
-rw-r--r--libgfortran/generated/minloc0_4_r4.c6
-rw-r--r--libgfortran/generated/minloc0_4_r8.c6
-rw-r--r--libgfortran/generated/minloc0_8_i1.c6
-rw-r--r--libgfortran/generated/minloc0_8_i16.c6
-rw-r--r--libgfortran/generated/minloc0_8_i2.c6
-rw-r--r--libgfortran/generated/minloc0_8_i4.c6
-rw-r--r--libgfortran/generated/minloc0_8_i8.c6
-rw-r--r--libgfortran/generated/minloc0_8_r10.c6
-rw-r--r--libgfortran/generated/minloc0_8_r16.c6
-rw-r--r--libgfortran/generated/minloc0_8_r4.c6
-rw-r--r--libgfortran/generated/minloc0_8_r8.c6
-rw-r--r--libgfortran/generated/minloc1_16_i1.c15
-rw-r--r--libgfortran/generated/minloc1_16_i16.c15
-rw-r--r--libgfortran/generated/minloc1_16_i2.c15
-rw-r--r--libgfortran/generated/minloc1_16_i4.c15
-rw-r--r--libgfortran/generated/minloc1_16_i8.c15
-rw-r--r--libgfortran/generated/minloc1_16_r10.c15
-rw-r--r--libgfortran/generated/minloc1_16_r16.c15
-rw-r--r--libgfortran/generated/minloc1_16_r4.c15
-rw-r--r--libgfortran/generated/minloc1_16_r8.c15
-rw-r--r--libgfortran/generated/minloc1_4_i1.c15
-rw-r--r--libgfortran/generated/minloc1_4_i16.c15
-rw-r--r--libgfortran/generated/minloc1_4_i2.c15
-rw-r--r--libgfortran/generated/minloc1_4_i4.c15
-rw-r--r--libgfortran/generated/minloc1_4_i8.c15
-rw-r--r--libgfortran/generated/minloc1_4_r10.c15
-rw-r--r--libgfortran/generated/minloc1_4_r16.c15
-rw-r--r--libgfortran/generated/minloc1_4_r4.c15
-rw-r--r--libgfortran/generated/minloc1_4_r8.c15
-rw-r--r--libgfortran/generated/minloc1_8_i1.c15
-rw-r--r--libgfortran/generated/minloc1_8_i16.c15
-rw-r--r--libgfortran/generated/minloc1_8_i2.c15
-rw-r--r--libgfortran/generated/minloc1_8_i4.c15
-rw-r--r--libgfortran/generated/minloc1_8_i8.c15
-rw-r--r--libgfortran/generated/minloc1_8_r10.c15
-rw-r--r--libgfortran/generated/minloc1_8_r16.c15
-rw-r--r--libgfortran/generated/minloc1_8_r4.c15
-rw-r--r--libgfortran/generated/minloc1_8_r8.c15
-rw-r--r--libgfortran/generated/minval_i1.c15
-rw-r--r--libgfortran/generated/minval_i16.c15
-rw-r--r--libgfortran/generated/minval_i2.c15
-rw-r--r--libgfortran/generated/minval_i4.c15
-rw-r--r--libgfortran/generated/minval_i8.c15
-rw-r--r--libgfortran/generated/minval_r10.c15
-rw-r--r--libgfortran/generated/minval_r16.c15
-rw-r--r--libgfortran/generated/minval_r4.c15
-rw-r--r--libgfortran/generated/minval_r8.c15
-rw-r--r--libgfortran/generated/norm2_r10.c5
-rw-r--r--libgfortran/generated/norm2_r16.c5
-rw-r--r--libgfortran/generated/norm2_r4.c5
-rw-r--r--libgfortran/generated/norm2_r8.c5
-rw-r--r--libgfortran/generated/pack_c10.c4
-rw-r--r--libgfortran/generated/pack_c16.c4
-rw-r--r--libgfortran/generated/pack_c4.c4
-rw-r--r--libgfortran/generated/pack_c8.c4
-rw-r--r--libgfortran/generated/pack_i1.c4
-rw-r--r--libgfortran/generated/pack_i16.c4
-rw-r--r--libgfortran/generated/pack_i2.c4
-rw-r--r--libgfortran/generated/pack_i4.c4
-rw-r--r--libgfortran/generated/pack_i8.c4
-rw-r--r--libgfortran/generated/pack_r10.c4
-rw-r--r--libgfortran/generated/pack_r16.c4
-rw-r--r--libgfortran/generated/pack_r4.c4
-rw-r--r--libgfortran/generated/pack_r8.c4
-rw-r--r--libgfortran/generated/parity_l1.c5
-rw-r--r--libgfortran/generated/parity_l16.c5
-rw-r--r--libgfortran/generated/parity_l2.c5
-rw-r--r--libgfortran/generated/parity_l4.c5
-rw-r--r--libgfortran/generated/parity_l8.c5
-rw-r--r--libgfortran/generated/product_c10.c15
-rw-r--r--libgfortran/generated/product_c16.c15
-rw-r--r--libgfortran/generated/product_c4.c15
-rw-r--r--libgfortran/generated/product_c8.c15
-rw-r--r--libgfortran/generated/product_i1.c15
-rw-r--r--libgfortran/generated/product_i16.c15
-rw-r--r--libgfortran/generated/product_i2.c15
-rw-r--r--libgfortran/generated/product_i4.c15
-rw-r--r--libgfortran/generated/product_i8.c15
-rw-r--r--libgfortran/generated/product_r10.c15
-rw-r--r--libgfortran/generated/product_r16.c15
-rw-r--r--libgfortran/generated/product_r4.c15
-rw-r--r--libgfortran/generated/product_r8.c15
-rw-r--r--libgfortran/generated/reshape_c10.c4
-rw-r--r--libgfortran/generated/reshape_c16.c4
-rw-r--r--libgfortran/generated/reshape_c4.c4
-rw-r--r--libgfortran/generated/reshape_c8.c4
-rw-r--r--libgfortran/generated/reshape_i16.c4
-rw-r--r--libgfortran/generated/reshape_i4.c4
-rw-r--r--libgfortran/generated/reshape_i8.c4
-rw-r--r--libgfortran/generated/reshape_r10.c4
-rw-r--r--libgfortran/generated/reshape_r16.c4
-rw-r--r--libgfortran/generated/reshape_r4.c4
-rw-r--r--libgfortran/generated/reshape_r8.c4
-rw-r--r--libgfortran/generated/shape_i16.c2
-rw-r--r--libgfortran/generated/shape_i4.c2
-rw-r--r--libgfortran/generated/shape_i8.c2
-rw-r--r--libgfortran/generated/spread_c10.c6
-rw-r--r--libgfortran/generated/spread_c16.c6
-rw-r--r--libgfortran/generated/spread_c4.c6
-rw-r--r--libgfortran/generated/spread_c8.c6
-rw-r--r--libgfortran/generated/spread_i1.c6
-rw-r--r--libgfortran/generated/spread_i16.c6
-rw-r--r--libgfortran/generated/spread_i2.c6
-rw-r--r--libgfortran/generated/spread_i4.c6
-rw-r--r--libgfortran/generated/spread_i8.c6
-rw-r--r--libgfortran/generated/spread_r10.c6
-rw-r--r--libgfortran/generated/spread_r16.c6
-rw-r--r--libgfortran/generated/spread_r4.c6
-rw-r--r--libgfortran/generated/spread_r8.c6
-rw-r--r--libgfortran/generated/sum_c10.c15
-rw-r--r--libgfortran/generated/sum_c16.c15
-rw-r--r--libgfortran/generated/sum_c4.c15
-rw-r--r--libgfortran/generated/sum_c8.c15
-rw-r--r--libgfortran/generated/sum_i1.c15
-rw-r--r--libgfortran/generated/sum_i16.c15
-rw-r--r--libgfortran/generated/sum_i2.c15
-rw-r--r--libgfortran/generated/sum_i4.c15
-rw-r--r--libgfortran/generated/sum_i8.c15
-rw-r--r--libgfortran/generated/sum_r10.c15
-rw-r--r--libgfortran/generated/sum_r16.c15
-rw-r--r--libgfortran/generated/sum_r4.c15
-rw-r--r--libgfortran/generated/sum_r8.c15
-rw-r--r--libgfortran/generated/transpose_c10.c3
-rw-r--r--libgfortran/generated/transpose_c16.c3
-rw-r--r--libgfortran/generated/transpose_c4.c3
-rw-r--r--libgfortran/generated/transpose_c8.c3
-rw-r--r--libgfortran/generated/transpose_i16.c3
-rw-r--r--libgfortran/generated/transpose_i4.c3
-rw-r--r--libgfortran/generated/transpose_i8.c3
-rw-r--r--libgfortran/generated/transpose_r10.c3
-rw-r--r--libgfortran/generated/transpose_r16.c3
-rw-r--r--libgfortran/generated/transpose_r4.c3
-rw-r--r--libgfortran/generated/transpose_r8.c3
-rw-r--r--libgfortran/generated/unpack_c10.c4
-rw-r--r--libgfortran/generated/unpack_c16.c4
-rw-r--r--libgfortran/generated/unpack_c4.c4
-rw-r--r--libgfortran/generated/unpack_c8.c4
-rw-r--r--libgfortran/generated/unpack_i1.c4
-rw-r--r--libgfortran/generated/unpack_i16.c4
-rw-r--r--libgfortran/generated/unpack_i2.c4
-rw-r--r--libgfortran/generated/unpack_i4.c4
-rw-r--r--libgfortran/generated/unpack_i8.c4
-rw-r--r--libgfortran/generated/unpack_r10.c4
-rw-r--r--libgfortran/generated/unpack_r16.c4
-rw-r--r--libgfortran/generated/unpack_r4.c4
-rw-r--r--libgfortran/generated/unpack_r8.c4
297 files changed, 1081 insertions, 1433 deletions
diff --git a/libgfortran/generated/all_l1.c b/libgfortran/generated/all_l1.c
index 5f23e6e22bc..76e11b79ff6 100644
--- a/libgfortran/generated/all_l1.c
+++ b/libgfortran/generated/all_l1.c
@@ -101,8 +101,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
}
else
{
diff --git a/libgfortran/generated/all_l16.c b/libgfortran/generated/all_l16.c
index 41e849b9e0a..85085224235 100644
--- a/libgfortran/generated/all_l16.c
+++ b/libgfortran/generated/all_l16.c
@@ -101,8 +101,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
}
else
{
diff --git a/libgfortran/generated/all_l2.c b/libgfortran/generated/all_l2.c
index a7308fd1dd6..763a25db0d3 100644
--- a/libgfortran/generated/all_l2.c
+++ b/libgfortran/generated/all_l2.c
@@ -101,8 +101,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
}
else
{
diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c
index ea4f0471e03..699f81afb6e 100644
--- a/libgfortran/generated/all_l4.c
+++ b/libgfortran/generated/all_l4.c
@@ -101,8 +101,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
}
else
{
diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c
index 617fb2d13f6..6710767f0fc 100644
--- a/libgfortran/generated/all_l8.c
+++ b/libgfortran/generated/all_l8.c
@@ -101,8 +101,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
}
else
{
diff --git a/libgfortran/generated/any_l1.c b/libgfortran/generated/any_l1.c
index c822b44d249..783f762b171 100644
--- a/libgfortran/generated/any_l1.c
+++ b/libgfortran/generated/any_l1.c
@@ -101,8 +101,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
}
else
{
diff --git a/libgfortran/generated/any_l16.c b/libgfortran/generated/any_l16.c
index 1e76d745c78..eb84fc3d950 100644
--- a/libgfortran/generated/any_l16.c
+++ b/libgfortran/generated/any_l16.c
@@ -101,8 +101,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
}
else
{
diff --git a/libgfortran/generated/any_l2.c b/libgfortran/generated/any_l2.c
index bc68eae222b..a5c34959796 100644
--- a/libgfortran/generated/any_l2.c
+++ b/libgfortran/generated/any_l2.c
@@ -101,8 +101,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
}
else
{
diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c
index dfd6dc25186..129fe997d6b 100644
--- a/libgfortran/generated/any_l4.c
+++ b/libgfortran/generated/any_l4.c
@@ -101,8 +101,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
}
else
{
diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c
index f5661e0b716..b358aba5b0e 100644
--- a/libgfortran/generated/any_l8.c
+++ b/libgfortran/generated/any_l8.c
@@ -101,8 +101,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
}
else
{
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c
index 8eb08cca8fd..cd55e1fdbd9 100644
--- a/libgfortran/generated/bessel_r10.c
+++ b/libgfortran/generated/bessel_r10.c
@@ -55,7 +55,7 @@ bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_10));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_10));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
ret->offset = 0;
}
diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c
index da7710a003f..aff3cd211b0 100644
--- a/libgfortran/generated/bessel_r16.c
+++ b/libgfortran/generated/bessel_r16.c
@@ -59,7 +59,7 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_16));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
ret->offset = 0;
}
@@ -126,7 +126,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_16));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
ret->offset = 0;
}
diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c
index b9ca4933484..186280aa66c 100644
--- a/libgfortran/generated/bessel_r4.c
+++ b/libgfortran/generated/bessel_r4.c
@@ -55,7 +55,7 @@ bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x)
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_4));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_4));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
ret->offset = 0;
}
diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c
index ff751630b02..ecc23d68c62 100644
--- a/libgfortran/generated/bessel_r8.c
+++ b/libgfortran/generated/bessel_r8.c
@@ -55,7 +55,7 @@ bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x)
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_8));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size, sizeof (GFC_REAL_8));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
ret->offset = 0;
}
diff --git a/libgfortran/generated/count_16_l.c b/libgfortran/generated/count_16_l.c
index 12d01b7ddb8..8557c058870 100644
--- a/libgfortran/generated/count_16_l.c
+++ b/libgfortran/generated/count_16_l.c
@@ -101,8 +101,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/count_1_l.c b/libgfortran/generated/count_1_l.c
index 6f8df444d1d..21024c13888 100644
--- a/libgfortran/generated/count_1_l.c
+++ b/libgfortran/generated/count_1_l.c
@@ -101,8 +101,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/count_2_l.c b/libgfortran/generated/count_2_l.c
index f74458723bc..2b3babb961c 100644
--- a/libgfortran/generated/count_2_l.c
+++ b/libgfortran/generated/count_2_l.c
@@ -101,8 +101,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/count_4_l.c b/libgfortran/generated/count_4_l.c
index 9a2f98e110e..4c902e98332 100644
--- a/libgfortran/generated/count_4_l.c
+++ b/libgfortran/generated/count_4_l.c
@@ -101,8 +101,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/count_8_l.c b/libgfortran/generated/count_8_l.c
index 329e3635b4f..83e1c5ee51c 100644
--- a/libgfortran/generated/count_8_l.c
+++ b/libgfortran/generated/count_8_l.c
@@ -101,8 +101,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c
index 86a4c76bb25..6ea2c6595ef 100644
--- a/libgfortran/generated/cshift1_16.c
+++ b/libgfortran/generated/cshift1_16.c
@@ -81,7 +81,7 @@ cshift1 (gfc_array_char * const restrict ret,
int i;
index_type sm, ext;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c
index 003674e00c3..4793e58f183 100644
--- a/libgfortran/generated/cshift1_4.c
+++ b/libgfortran/generated/cshift1_4.c
@@ -81,7 +81,7 @@ cshift1 (gfc_array_char * const restrict ret,
int i;
index_type sm, ext;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c
index c76a4d7ed85..9be7415b628 100644
--- a/libgfortran/generated/cshift1_8.c
+++ b/libgfortran/generated/cshift1_8.c
@@ -81,7 +81,7 @@ cshift1 (gfc_array_char * const restrict ret,
int i;
index_type sm, ext;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c
index 8b098fb0629..06a3682035c 100644
--- a/libgfortran/generated/eoshift1_16.c
+++ b/libgfortran/generated/eoshift1_16.c
@@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c
index 7c61a185884..7b0b4929aa7 100644
--- a/libgfortran/generated/eoshift1_4.c
+++ b/libgfortran/generated/eoshift1_4.c
@@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c
index 449e0c2bd72..368a463a19b 100644
--- a/libgfortran/generated/eoshift1_8.c
+++ b/libgfortran/generated/eoshift1_8.c
@@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c
index cb46ff36629..c494cea7c20 100644
--- a/libgfortran/generated/eoshift3_16.c
+++ b/libgfortran/generated/eoshift3_16.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
@@ -108,8 +108,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c
index f080258c8c1..7d00e36f61a 100644
--- a/libgfortran/generated/eoshift3_4.c
+++ b/libgfortran/generated/eoshift3_4.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
@@ -108,8 +108,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c
index 8c7cb5217b1..3657ea2d589 100644
--- a/libgfortran/generated/eoshift3_8.c
+++ b/libgfortran/generated/eoshift3_8.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->elem_len = array->elem_len;
ret->type = array->type;
ret->offset = 0;
@@ -108,8 +108,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c
index ab3b35bd0a9..0e4c6f5dc46 100644
--- a/libgfortran/generated/iall_i1.c
+++ b/libgfortran/generated/iall_i1.c
@@ -98,10 +98,9 @@ iall_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -432,8 +430,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index 656b5049173..33f3764b46f 100644
--- a/libgfortran/generated/iall_i16.c
+++ b/libgfortran/generated/iall_i16.c
@@ -98,10 +98,9 @@ iall_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -432,8 +430,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index 8df1bd081b8..52dc1da37e5 100644
--- a/libgfortran/generated/iall_i2.c
+++ b/libgfortran/generated/iall_i2.c
@@ -98,10 +98,9 @@ iall_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -432,8 +430,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index a4288c09a06..bca8e950ebb 100644
--- a/libgfortran/generated/iall_i4.c
+++ b/libgfortran/generated/iall_i4.c
@@ -98,10 +98,9 @@ iall_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -432,8 +430,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index e0b454a4b90..d0cf056302a 100644
--- a/libgfortran/generated/iall_i8.c
+++ b/libgfortran/generated/iall_i8.c
@@ -98,10 +98,9 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -432,8 +430,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index 3288ea27e0c..0a2fcd9d79f 100644
--- a/libgfortran/generated/iany_i1.c
+++ b/libgfortran/generated/iany_i1.c
@@ -98,10 +98,9 @@ iany_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -432,8 +430,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index 64601905f6f..fc61c2104c3 100644
--- a/libgfortran/generated/iany_i16.c
+++ b/libgfortran/generated/iany_i16.c
@@ -98,10 +98,9 @@ iany_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -432,8 +430,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index 5dee561a8bb..a58c458d6c1 100644
--- a/libgfortran/generated/iany_i2.c
+++ b/libgfortran/generated/iany_i2.c
@@ -98,10 +98,9 @@ iany_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -432,8 +430,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index 25d02901c3e..7f081878907 100644
--- a/libgfortran/generated/iany_i4.c
+++ b/libgfortran/generated/iany_i4.c
@@ -98,10 +98,9 @@ iany_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -432,8 +430,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index 39018015114..ca3dea818a8 100644
--- a/libgfortran/generated/iany_i8.c
+++ b/libgfortran/generated/iany_i8.c
@@ -98,10 +98,9 @@ iany_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -432,8 +430,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/in_pack_c10.c b/libgfortran/generated/in_pack_c10.c
index 4e2d585cb4f..ba2656115e7 100644
--- a/libgfortran/generated/in_pack_c10.c
+++ b/libgfortran/generated/in_pack_c10.c
@@ -76,7 +76,7 @@ internal_pack_c10 (gfc_array_c10 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_c16.c b/libgfortran/generated/in_pack_c16.c
index febbbce5acc..f2285dcd60e 100644
--- a/libgfortran/generated/in_pack_c16.c
+++ b/libgfortran/generated/in_pack_c16.c
@@ -76,7 +76,7 @@ internal_pack_c16 (gfc_array_c16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_c4.c b/libgfortran/generated/in_pack_c4.c
index d9e04e050a1..116cb6380df 100644
--- a/libgfortran/generated/in_pack_c4.c
+++ b/libgfortran/generated/in_pack_c4.c
@@ -76,7 +76,7 @@ internal_pack_c4 (gfc_array_c4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_c8.c b/libgfortran/generated/in_pack_c8.c
index 496a8c0a400..f56e6bc8328 100644
--- a/libgfortran/generated/in_pack_c8.c
+++ b/libgfortran/generated/in_pack_c8.c
@@ -76,7 +76,7 @@ internal_pack_c8 (gfc_array_c8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_i1.c b/libgfortran/generated/in_pack_i1.c
index 0abb92fe60f..1a185ce6eef 100644
--- a/libgfortran/generated/in_pack_i1.c
+++ b/libgfortran/generated/in_pack_i1.c
@@ -76,7 +76,7 @@ internal_pack_1 (gfc_array_i1 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_i16.c b/libgfortran/generated/in_pack_i16.c
index ea66ec38f29..b4537aa71e4 100644
--- a/libgfortran/generated/in_pack_i16.c
+++ b/libgfortran/generated/in_pack_i16.c
@@ -76,7 +76,7 @@ internal_pack_16 (gfc_array_i16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_i2.c b/libgfortran/generated/in_pack_i2.c
index 6ac7845ad52..99bc9814a34 100644
--- a/libgfortran/generated/in_pack_i2.c
+++ b/libgfortran/generated/in_pack_i2.c
@@ -76,7 +76,7 @@ internal_pack_2 (gfc_array_i2 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_i4.c b/libgfortran/generated/in_pack_i4.c
index b2779d5e2d8..f8a3a9694ac 100644
--- a/libgfortran/generated/in_pack_i4.c
+++ b/libgfortran/generated/in_pack_i4.c
@@ -76,7 +76,7 @@ internal_pack_4 (gfc_array_i4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_i8.c b/libgfortran/generated/in_pack_i8.c
index 6aec3660beb..7c3a927cad4 100644
--- a/libgfortran/generated/in_pack_i8.c
+++ b/libgfortran/generated/in_pack_i8.c
@@ -76,7 +76,7 @@ internal_pack_8 (gfc_array_i8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_r10.c b/libgfortran/generated/in_pack_r10.c
index f924639f546..01b9a83b35b 100644
--- a/libgfortran/generated/in_pack_r10.c
+++ b/libgfortran/generated/in_pack_r10.c
@@ -76,7 +76,7 @@ internal_pack_r10 (gfc_array_r10 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_r16.c b/libgfortran/generated/in_pack_r16.c
index 108690d7ff6..9f4d68b556a 100644
--- a/libgfortran/generated/in_pack_r16.c
+++ b/libgfortran/generated/in_pack_r16.c
@@ -76,7 +76,7 @@ internal_pack_r16 (gfc_array_r16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_r4.c b/libgfortran/generated/in_pack_r4.c
index 0affbf2d015..316a644477e 100644
--- a/libgfortran/generated/in_pack_r4.c
+++ b/libgfortran/generated/in_pack_r4.c
@@ -76,7 +76,7 @@ internal_pack_r4 (gfc_array_r4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/in_pack_r8.c b/libgfortran/generated/in_pack_r8.c
index b408a4810c0..be5a761e4af 100644
--- a/libgfortran/generated/in_pack_r8.c
+++ b/libgfortran/generated/in_pack_r8.c
@@ -76,7 +76,7 @@ internal_pack_r8 (gfc_array_r8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index f39ecc4f241..9c96e07e2f2 100644
--- a/libgfortran/generated/iparity_i1.c
+++ b/libgfortran/generated/iparity_i1.c
@@ -98,10 +98,9 @@ iparity_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -432,8 +430,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index 189193c272a..6a17f4990ca 100644
--- a/libgfortran/generated/iparity_i16.c
+++ b/libgfortran/generated/iparity_i16.c
@@ -98,10 +98,9 @@ iparity_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -432,8 +430,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index afa85df57b3..7fd85d40869 100644
--- a/libgfortran/generated/iparity_i2.c
+++ b/libgfortran/generated/iparity_i2.c
@@ -98,10 +98,9 @@ iparity_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -432,8 +430,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index 7f8d3544992..1e03b3cb5d2 100644
--- a/libgfortran/generated/iparity_i4.c
+++ b/libgfortran/generated/iparity_i4.c
@@ -98,10 +98,9 @@ iparity_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -432,8 +430,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index f92397468b5..2d7e8407d7e 100644
--- a/libgfortran/generated/iparity_i8.c
+++ b/libgfortran/generated/iparity_i8.c
@@ -98,10 +98,9 @@ iparity_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -432,8 +430,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c
index ad87817fe84..d7af93c88e6 100644
--- a/libgfortran/generated/matmul_c10.c
+++ b/libgfortran/generated/matmul_c10.c
@@ -125,7 +125,7 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_c16.c b/libgfortran/generated/matmul_c16.c
index 43454e4f0da..f94e89e09d5 100644
--- a/libgfortran/generated/matmul_c16.c
+++ b/libgfortran/generated/matmul_c16.c
@@ -125,7 +125,7 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c
index 3b51153e825..5192e0822c2 100644
--- a/libgfortran/generated/matmul_c4.c
+++ b/libgfortran/generated/matmul_c4.c
@@ -125,7 +125,7 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c
index 9d6712f9e81..93d737fc9d2 100644
--- a/libgfortran/generated/matmul_c8.c
+++ b/libgfortran/generated/matmul_c8.c
@@ -125,7 +125,7 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_i1.c b/libgfortran/generated/matmul_i1.c
index 71204b3a9ee..07c6ffece24 100644
--- a/libgfortran/generated/matmul_i1.c
+++ b/libgfortran/generated/matmul_i1.c
@@ -125,7 +125,7 @@ matmul_i1 (gfc_array_i1 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_i16.c b/libgfortran/generated/matmul_i16.c
index 1441eb98945..e477d8b5e80 100644
--- a/libgfortran/generated/matmul_i16.c
+++ b/libgfortran/generated/matmul_i16.c
@@ -125,7 +125,7 @@ matmul_i16 (gfc_array_i16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_i2.c b/libgfortran/generated/matmul_i2.c
index a655fbf4c13..7b2a5f683f9 100644
--- a/libgfortran/generated/matmul_i2.c
+++ b/libgfortran/generated/matmul_i2.c
@@ -125,7 +125,7 @@ matmul_i2 (gfc_array_i2 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c
index 4513c801037..a650f0ad4f7 100644
--- a/libgfortran/generated/matmul_i4.c
+++ b/libgfortran/generated/matmul_i4.c
@@ -125,7 +125,7 @@ matmul_i4 (gfc_array_i4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c
index 5019a68f4ef..c7efc77f15d 100644
--- a/libgfortran/generated/matmul_i8.c
+++ b/libgfortran/generated/matmul_i8.c
@@ -125,7 +125,7 @@ matmul_i8 (gfc_array_i8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_l16.c b/libgfortran/generated/matmul_l16.c
index 20c3bdfcbbd..1e016587d03 100644
--- a/libgfortran/generated/matmul_l16.c
+++ b/libgfortran/generated/matmul_l16.c
@@ -89,7 +89,7 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_l4.c b/libgfortran/generated/matmul_l4.c
index e17ea56c603..2b3d870acc4 100644
--- a/libgfortran/generated/matmul_l4.c
+++ b/libgfortran/generated/matmul_l4.c
@@ -89,7 +89,7 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_l8.c b/libgfortran/generated/matmul_l8.c
index 5866fb4f1eb..bff2852166b 100644
--- a/libgfortran/generated/matmul_l8.c
+++ b/libgfortran/generated/matmul_l8.c
@@ -89,7 +89,7 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_r10.c b/libgfortran/generated/matmul_r10.c
index 41c01fcc54f..9959f6a9977 100644
--- a/libgfortran/generated/matmul_r10.c
+++ b/libgfortran/generated/matmul_r10.c
@@ -125,7 +125,7 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_r16.c b/libgfortran/generated/matmul_r16.c
index f5f6b925b0f..bc43ca21291 100644
--- a/libgfortran/generated/matmul_r16.c
+++ b/libgfortran/generated/matmul_r16.c
@@ -125,7 +125,7 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c
index 2aa632f4fd4..8fd3849b726 100644
--- a/libgfortran/generated/matmul_r4.c
+++ b/libgfortran/generated/matmul_r4.c
@@ -125,7 +125,7 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c
index dc11452bfc8..ca7adb309aa 100644
--- a/libgfortran/generated/matmul_r8.c
+++ b/libgfortran/generated/matmul_r8.c
@@ -125,7 +125,7 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/maxloc0_16_i1.c b/libgfortran/generated/maxloc0_16_i1.c
index 7599e2f01d2..792f59fb683 100644
--- a/libgfortran/generated/maxloc0_16_i1.c
+++ b/libgfortran/generated/maxloc0_16_i1.c
@@ -59,7 +59,7 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_i16.c b/libgfortran/generated/maxloc0_16_i16.c
index 7db5d770f37..6e35ac7c6f0 100644
--- a/libgfortran/generated/maxloc0_16_i16.c
+++ b/libgfortran/generated/maxloc0_16_i16.c
@@ -59,7 +59,7 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_i2.c b/libgfortran/generated/maxloc0_16_i2.c
index 60842b0b575..eaeeab93f58 100644
--- a/libgfortran/generated/maxloc0_16_i2.c
+++ b/libgfortran/generated/maxloc0_16_i2.c
@@ -59,7 +59,7 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_i4.c b/libgfortran/generated/maxloc0_16_i4.c
index bde420802c8..5d8acb0e72b 100644
--- a/libgfortran/generated/maxloc0_16_i4.c
+++ b/libgfortran/generated/maxloc0_16_i4.c
@@ -59,7 +59,7 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_i8.c b/libgfortran/generated/maxloc0_16_i8.c
index 5f11d70d997..cd315741ffd 100644
--- a/libgfortran/generated/maxloc0_16_i8.c
+++ b/libgfortran/generated/maxloc0_16_i8.c
@@ -59,7 +59,7 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_r10.c b/libgfortran/generated/maxloc0_16_r10.c
index 87de7a7febb..089e751dc8a 100644
--- a/libgfortran/generated/maxloc0_16_r10.c
+++ b/libgfortran/generated/maxloc0_16_r10.c
@@ -59,7 +59,7 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_r16.c b/libgfortran/generated/maxloc0_16_r16.c
index e643280a852..1c423e7847b 100644
--- a/libgfortran/generated/maxloc0_16_r16.c
+++ b/libgfortran/generated/maxloc0_16_r16.c
@@ -59,7 +59,7 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_r4.c b/libgfortran/generated/maxloc0_16_r4.c
index fb0b69d03d9..28ae3829f95 100644
--- a/libgfortran/generated/maxloc0_16_r4.c
+++ b/libgfortran/generated/maxloc0_16_r4.c
@@ -59,7 +59,7 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_16_r8.c b/libgfortran/generated/maxloc0_16_r8.c
index 96956c4d75d..0f17f337882 100644
--- a/libgfortran/generated/maxloc0_16_r8.c
+++ b/libgfortran/generated/maxloc0_16_r8.c
@@ -59,7 +59,7 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_i1.c b/libgfortran/generated/maxloc0_4_i1.c
index 4a388d82db2..63f8564d8f3 100644
--- a/libgfortran/generated/maxloc0_4_i1.c
+++ b/libgfortran/generated/maxloc0_4_i1.c
@@ -59,7 +59,7 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_i16.c b/libgfortran/generated/maxloc0_4_i16.c
index 3039dda689f..053fd05fb34 100644
--- a/libgfortran/generated/maxloc0_4_i16.c
+++ b/libgfortran/generated/maxloc0_4_i16.c
@@ -59,7 +59,7 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_i2.c b/libgfortran/generated/maxloc0_4_i2.c
index 3ea64f62071..e0ee681f04d 100644
--- a/libgfortran/generated/maxloc0_4_i2.c
+++ b/libgfortran/generated/maxloc0_4_i2.c
@@ -59,7 +59,7 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c
index c1d163762f2..ad793633f9b 100644
--- a/libgfortran/generated/maxloc0_4_i4.c
+++ b/libgfortran/generated/maxloc0_4_i4.c
@@ -59,7 +59,7 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c
index 2d14ddfeb87..335ad26f815 100644
--- a/libgfortran/generated/maxloc0_4_i8.c
+++ b/libgfortran/generated/maxloc0_4_i8.c
@@ -59,7 +59,7 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_r10.c b/libgfortran/generated/maxloc0_4_r10.c
index baf3cb52d34..54701204074 100644
--- a/libgfortran/generated/maxloc0_4_r10.c
+++ b/libgfortran/generated/maxloc0_4_r10.c
@@ -59,7 +59,7 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_r16.c b/libgfortran/generated/maxloc0_4_r16.c
index 22867a597ef..60352e19f17 100644
--- a/libgfortran/generated/maxloc0_4_r16.c
+++ b/libgfortran/generated/maxloc0_4_r16.c
@@ -59,7 +59,7 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c
index be7be4bbc8b..af9f83bb909 100644
--- a/libgfortran/generated/maxloc0_4_r4.c
+++ b/libgfortran/generated/maxloc0_4_r4.c
@@ -59,7 +59,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c
index 077cc6c820c..2c70d47f440 100644
--- a/libgfortran/generated/maxloc0_4_r8.c
+++ b/libgfortran/generated/maxloc0_4_r8.c
@@ -59,7 +59,7 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_i1.c b/libgfortran/generated/maxloc0_8_i1.c
index 20872b34026..341fadb8b16 100644
--- a/libgfortran/generated/maxloc0_8_i1.c
+++ b/libgfortran/generated/maxloc0_8_i1.c
@@ -59,7 +59,7 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_i16.c b/libgfortran/generated/maxloc0_8_i16.c
index 979ea2caeb4..5d4d978b64c 100644
--- a/libgfortran/generated/maxloc0_8_i16.c
+++ b/libgfortran/generated/maxloc0_8_i16.c
@@ -59,7 +59,7 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_i2.c b/libgfortran/generated/maxloc0_8_i2.c
index 903015c2b21..1a19a1fd1db 100644
--- a/libgfortran/generated/maxloc0_8_i2.c
+++ b/libgfortran/generated/maxloc0_8_i2.c
@@ -59,7 +59,7 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c
index 7ad04f2f2ad..d3745aa8b6e 100644
--- a/libgfortran/generated/maxloc0_8_i4.c
+++ b/libgfortran/generated/maxloc0_8_i4.c
@@ -59,7 +59,7 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c
index 2b6bde7208a..4ac8ff5fc5c 100644
--- a/libgfortran/generated/maxloc0_8_i8.c
+++ b/libgfortran/generated/maxloc0_8_i8.c
@@ -59,7 +59,7 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_r10.c b/libgfortran/generated/maxloc0_8_r10.c
index c8fc79213af..8bd4d257182 100644
--- a/libgfortran/generated/maxloc0_8_r10.c
+++ b/libgfortran/generated/maxloc0_8_r10.c
@@ -59,7 +59,7 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c
index 2a0d979814c..33068477d23 100644
--- a/libgfortran/generated/maxloc0_8_r16.c
+++ b/libgfortran/generated/maxloc0_8_r16.c
@@ -59,7 +59,7 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c
index 58887484d3c..7abef9f34a9 100644
--- a/libgfortran/generated/maxloc0_8_r4.c
+++ b/libgfortran/generated/maxloc0_8_r4.c
@@ -59,7 +59,7 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c
index e67cd6f5a59..9d163d6ddaa 100644
--- a/libgfortran/generated/maxloc0_8_r8.c
+++ b/libgfortran/generated/maxloc0_8_r8.c
@@ -59,7 +59,7 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index 029a794ce4b..4bae2d2e0db 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -99,10 +99,9 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index ec5fb65667d..03d3198c7f9 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -99,10 +99,9 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 59b0532e9f7..d2acb3775a5 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -99,10 +99,9 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index d5e9dca83cb..cd1650135ec 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -99,10 +99,9 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index 52a86d2489c..0584bf38bba 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -99,10 +99,9 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index 61a005c6406..3c01efb2d6f 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -99,10 +99,9 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index 0b53c4211c2..18fee74173d 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -99,10 +99,9 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index d4aadc3a5e7..c268600c67b 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -99,10 +99,9 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index e5dda0b1884..b3d5141b64f 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -99,10 +99,9 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index 6a6a02c40a4..678181b7e3e 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -99,10 +99,9 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index b7c7d1950e3..4f468836fc1 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -99,10 +99,9 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index d0f66c07964..89df835d7a3 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -99,10 +99,9 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 3be68aee24a..86cb7ea74c1 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -99,10 +99,9 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index 549dc416019..76d5aec2c58 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -99,10 +99,9 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index ee0fb311bcb..6322e19aaf8 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -99,10 +99,9 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index 5a36f6be97e..f2779e49cfe 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -99,10 +99,9 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 675a4e7a977..b5ea02dfedf 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -99,10 +99,9 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index b7f1c3f8d83..0cb7db50d1d 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -99,10 +99,9 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index 9932ed6fd06..4d0827a0d77 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -99,10 +99,9 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 9a8a6563594..3f7c2edfedc 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -99,10 +99,9 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index a2d4ab99c5a..3be4387b8b3 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -99,10 +99,9 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index c4f7a3f4f25..4adf1280979 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -99,10 +99,9 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index a63c5327c3a..37f5609fc0c 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -99,10 +99,9 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index de2ae4b5336..ec8040e23bf 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -99,10 +99,9 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 916e87d71e7..c5e85b1f499 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -99,10 +99,9 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index b25cef7ef51..ad0fa1dd566 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -99,10 +99,9 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index 3034d079602..5b9ecf7b691 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -99,10 +99,9 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index 1daeae810ac..708a6b4cd7b 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -98,10 +98,9 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -474,8 +472,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index a87bc89ead5..803949c151f 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -98,10 +98,9 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -474,8 +472,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index bcc2b64b25b..e77ab736b1f 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -98,10 +98,9 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -474,8 +472,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index 8a6b8f3e83a..29a8c793de9 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -98,10 +98,9 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -474,8 +472,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index b8ea6c5f4f7..11de2b01db0 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -98,10 +98,9 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -474,8 +472,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index 066fb54b9fb..0571233f958 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -98,10 +98,9 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -474,8 +472,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index c80cd93a5e3..aef3064eae9 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -98,10 +98,9 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -474,8 +472,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index a7350f165c5..d82e44bc6f9 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -98,10 +98,9 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -474,8 +472,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index c596783eaf1..070f87b281a 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -98,10 +98,9 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -474,8 +472,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/libgfortran/generated/minloc0_16_i1.c b/libgfortran/generated/minloc0_16_i1.c
index a34ced672ef..d74b3f7d60b 100644
--- a/libgfortran/generated/minloc0_16_i1.c
+++ b/libgfortran/generated/minloc0_16_i1.c
@@ -59,7 +59,7 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_i16.c b/libgfortran/generated/minloc0_16_i16.c
index 7c31c9326ff..5ae2f39bf92 100644
--- a/libgfortran/generated/minloc0_16_i16.c
+++ b/libgfortran/generated/minloc0_16_i16.c
@@ -59,7 +59,7 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_i2.c b/libgfortran/generated/minloc0_16_i2.c
index e085b918739..8e9df536c36 100644
--- a/libgfortran/generated/minloc0_16_i2.c
+++ b/libgfortran/generated/minloc0_16_i2.c
@@ -59,7 +59,7 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_i4.c b/libgfortran/generated/minloc0_16_i4.c
index 0b2e14c51c4..d626e812399 100644
--- a/libgfortran/generated/minloc0_16_i4.c
+++ b/libgfortran/generated/minloc0_16_i4.c
@@ -59,7 +59,7 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_i8.c b/libgfortran/generated/minloc0_16_i8.c
index e6c30fe9bc2..bf611b6b3c2 100644
--- a/libgfortran/generated/minloc0_16_i8.c
+++ b/libgfortran/generated/minloc0_16_i8.c
@@ -59,7 +59,7 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_r10.c b/libgfortran/generated/minloc0_16_r10.c
index f88cd72095b..fa6bc79aa84 100644
--- a/libgfortran/generated/minloc0_16_r10.c
+++ b/libgfortran/generated/minloc0_16_r10.c
@@ -59,7 +59,7 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_r16.c b/libgfortran/generated/minloc0_16_r16.c
index 36b90fb490e..b1ae2e1d1ec 100644
--- a/libgfortran/generated/minloc0_16_r16.c
+++ b/libgfortran/generated/minloc0_16_r16.c
@@ -59,7 +59,7 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_r4.c b/libgfortran/generated/minloc0_16_r4.c
index 373cdc526ac..0cbe3382531 100644
--- a/libgfortran/generated/minloc0_16_r4.c
+++ b/libgfortran/generated/minloc0_16_r4.c
@@ -59,7 +59,7 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_16_r8.c b/libgfortran/generated/minloc0_16_r8.c
index b52873302c4..40f33c3af20 100644
--- a/libgfortran/generated/minloc0_16_r8.c
+++ b/libgfortran/generated/minloc0_16_r8.c
@@ -59,7 +59,7 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_i1.c b/libgfortran/generated/minloc0_4_i1.c
index 5ff676379af..6e88e0077fc 100644
--- a/libgfortran/generated/minloc0_4_i1.c
+++ b/libgfortran/generated/minloc0_4_i1.c
@@ -59,7 +59,7 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_i16.c b/libgfortran/generated/minloc0_4_i16.c
index 653aa48be9f..62399930b3b 100644
--- a/libgfortran/generated/minloc0_4_i16.c
+++ b/libgfortran/generated/minloc0_4_i16.c
@@ -59,7 +59,7 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_i2.c b/libgfortran/generated/minloc0_4_i2.c
index 42d0431fbd4..9f9ec121fbb 100644
--- a/libgfortran/generated/minloc0_4_i2.c
+++ b/libgfortran/generated/minloc0_4_i2.c
@@ -59,7 +59,7 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c
index 6f983af4339..05cdab8929d 100644
--- a/libgfortran/generated/minloc0_4_i4.c
+++ b/libgfortran/generated/minloc0_4_i4.c
@@ -59,7 +59,7 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c
index 51875aacb75..b8602cad787 100644
--- a/libgfortran/generated/minloc0_4_i8.c
+++ b/libgfortran/generated/minloc0_4_i8.c
@@ -59,7 +59,7 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_r10.c b/libgfortran/generated/minloc0_4_r10.c
index 31c7fa722ee..b30bb8633f0 100644
--- a/libgfortran/generated/minloc0_4_r10.c
+++ b/libgfortran/generated/minloc0_4_r10.c
@@ -59,7 +59,7 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_r16.c b/libgfortran/generated/minloc0_4_r16.c
index 826c0687301..721d39cdca9 100644
--- a/libgfortran/generated/minloc0_4_r16.c
+++ b/libgfortran/generated/minloc0_4_r16.c
@@ -59,7 +59,7 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c
index 05631387e83..2babc439f01 100644
--- a/libgfortran/generated/minloc0_4_r4.c
+++ b/libgfortran/generated/minloc0_4_r4.c
@@ -59,7 +59,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c
index d3400301f60..ff8ff5f6cf0 100644
--- a/libgfortran/generated/minloc0_4_r8.c
+++ b/libgfortran/generated/minloc0_4_r8.c
@@ -59,7 +59,7 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_i1.c b/libgfortran/generated/minloc0_8_i1.c
index 13f5b80503e..3c8700e4204 100644
--- a/libgfortran/generated/minloc0_8_i1.c
+++ b/libgfortran/generated/minloc0_8_i1.c
@@ -59,7 +59,7 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_i16.c b/libgfortran/generated/minloc0_8_i16.c
index d494c677bd6..945ec4c9c8f 100644
--- a/libgfortran/generated/minloc0_8_i16.c
+++ b/libgfortran/generated/minloc0_8_i16.c
@@ -59,7 +59,7 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_i2.c b/libgfortran/generated/minloc0_8_i2.c
index 1da598a97e0..2511b339af3 100644
--- a/libgfortran/generated/minloc0_8_i2.c
+++ b/libgfortran/generated/minloc0_8_i2.c
@@ -59,7 +59,7 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c
index c5ed118b8cd..58fe1023518 100644
--- a/libgfortran/generated/minloc0_8_i4.c
+++ b/libgfortran/generated/minloc0_8_i4.c
@@ -59,7 +59,7 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c
index 4cec8e2ea06..f1bc31e2e29 100644
--- a/libgfortran/generated/minloc0_8_i8.c
+++ b/libgfortran/generated/minloc0_8_i8.c
@@ -59,7 +59,7 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_r10.c b/libgfortran/generated/minloc0_8_r10.c
index 9f576509e01..e2bf5273b7a 100644
--- a/libgfortran/generated/minloc0_8_r10.c
+++ b/libgfortran/generated/minloc0_8_r10.c
@@ -59,7 +59,7 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_r16.c b/libgfortran/generated/minloc0_8_r16.c
index 12efc36e40f..dbe35d08cad 100644
--- a/libgfortran/generated/minloc0_8_r16.c
+++ b/libgfortran/generated/minloc0_8_r16.c
@@ -59,7 +59,7 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c
index 8ff779f3b72..2db1a110fb3 100644
--- a/libgfortran/generated/minloc0_8_r4.c
+++ b/libgfortran/generated/minloc0_8_r4.c
@@ -59,7 +59,7 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c
index aad978ad7c4..2a492c6f1b8 100644
--- a/libgfortran/generated/minloc0_8_r8.c
+++ b/libgfortran/generated/minloc0_8_r8.c
@@ -59,7 +59,7 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -201,7 +201,7 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = retarray->elem_len;
retarray->type = retarray->type;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -368,7 +368,7 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
{
GFC_DIMENSION_SET (retarray->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index 7f05bae4a35..a9ef738c4f7 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -99,10 +99,9 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index 4172c62d790..f4b422aea62 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -99,10 +99,9 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index dd80c0060b6..a035ef35ef2 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -99,10 +99,9 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 9104a4f095e..71140968e5b 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -99,10 +99,9 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index d7d220c25f0..a9a1f0a571e 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -99,10 +99,9 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index 94c271d81cc..95f6b9263a8 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -99,10 +99,9 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index 9292f1addf5..26f7f4cfd65 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -99,10 +99,9 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index 6a928fd01fd..81149b6e4b9 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -99,10 +99,9 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 858ed975999..3404c2493a9 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -99,10 +99,9 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -487,8 +485,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 024668e8f15..b71337b6745 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -99,10 +99,9 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index f721e419bbf..1fb9219ff34 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -99,10 +99,9 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index e0e8a9eccf0..e61bf95ab5f 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -99,10 +99,9 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 303c7128100..64cf2daa98a 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -99,10 +99,9 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index e6bbc3851e5..ab74930c337 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -99,10 +99,9 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index adb55fc53b5..fd0b874a90b 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -99,10 +99,9 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index 840da057346..186f18b993f 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -99,10 +99,9 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index b32fd1e102e..939692473ed 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -99,10 +99,9 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index a4c44ee8527..dce1851b005 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -99,10 +99,9 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -487,8 +485,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 9968a5e514b..0c43c925c35 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -99,10 +99,9 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index ad401954bf6..f0d218134cb 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -99,10 +99,9 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index d35843c632d..fe5ffd876ec 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -99,10 +99,9 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index d49715bffe6..30097d0b307 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -99,10 +99,9 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 3ae55851f95..76e4c11df2a 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -99,10 +99,9 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index 374cdabec88..df42b81cd5f 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -99,10 +99,9 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index 0fd75d04213..d10725402c0 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -99,10 +99,9 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index 515e66f4be7..77450ac6b52 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -99,10 +99,9 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index 5da6fb6449c..ce72c0de849 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -99,10 +99,9 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -295,8 +294,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -309,7 +307,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -487,8 +485,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -497,7 +494,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index 327b51da069..723aa549de0 100644
--- a/libgfortran/generated/minval_i1.c
+++ b/libgfortran/generated/minval_i1.c
@@ -98,10 +98,9 @@ minval_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -474,8 +472,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index 846498526fb..2679fc86945 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -98,10 +98,9 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -474,8 +472,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index 3dbb4a50767..b18c4331b91 100644
--- a/libgfortran/generated/minval_i2.c
+++ b/libgfortran/generated/minval_i2.c
@@ -98,10 +98,9 @@ minval_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -474,8 +472,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index f0b56f5cba5..adebe0c26cd 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -98,10 +98,9 @@ minval_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -474,8 +472,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 57d1cae1963..764d4649f41 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -98,10 +98,9 @@ minval_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -474,8 +472,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index f91a77354df..091919be105 100644
--- a/libgfortran/generated/minval_r10.c
+++ b/libgfortran/generated/minval_r10.c
@@ -98,10 +98,9 @@ minval_r10 (gfc_array_r10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -474,8 +472,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c
index 9791f4a5ba2..0f270d55701 100644
--- a/libgfortran/generated/minval_r16.c
+++ b/libgfortran/generated/minval_r16.c
@@ -98,10 +98,9 @@ minval_r16 (gfc_array_r16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -474,8 +472,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index b7ec6585ff5..8e7068348db 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -98,10 +98,9 @@ minval_r4 (gfc_array_r4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -474,8 +472,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index f2160bfba02..99523caad2f 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -98,10 +98,9 @@ minval_r8 (gfc_array_r8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -287,8 +286,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -301,7 +299,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -474,8 +472,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -484,7 +481,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/libgfortran/generated/norm2_r10.c b/libgfortran/generated/norm2_r10.c
index 32845671e36..d414e6dadea 100644
--- a/libgfortran/generated/norm2_r10.c
+++ b/libgfortran/generated/norm2_r10.c
@@ -102,10 +102,9 @@ norm2_r10 (gfc_array_r10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/norm2_r16.c b/libgfortran/generated/norm2_r16.c
index 395ffb14012..da4445a35d2 100644
--- a/libgfortran/generated/norm2_r16.c
+++ b/libgfortran/generated/norm2_r16.c
@@ -106,10 +106,9 @@ norm2_r16 (gfc_array_r16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/norm2_r4.c b/libgfortran/generated/norm2_r4.c
index 493068e7cb8..5e7a2b9382b 100644
--- a/libgfortran/generated/norm2_r4.c
+++ b/libgfortran/generated/norm2_r4.c
@@ -102,10 +102,9 @@ norm2_r4 (gfc_array_r4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/norm2_r8.c b/libgfortran/generated/norm2_r8.c
index 9eededdf726..f96f8a45ac5 100644
--- a/libgfortran/generated/norm2_r8.c
+++ b/libgfortran/generated/norm2_r8.c
@@ -102,10 +102,9 @@ norm2_r8 (gfc_array_r8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/pack_c10.c b/libgfortran/generated/pack_c10.c
index 53f7b5d8015..28ecabf8cd0 100644
--- a/libgfortran/generated/pack_c10.c
+++ b/libgfortran/generated/pack_c10.c
@@ -167,8 +167,8 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_c16.c b/libgfortran/generated/pack_c16.c
index 5ca18035cf5..05e0fc3525e 100644
--- a/libgfortran/generated/pack_c16.c
+++ b/libgfortran/generated/pack_c16.c
@@ -167,8 +167,8 @@ pack_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_c4.c b/libgfortran/generated/pack_c4.c
index df561b657a4..39695ada844 100644
--- a/libgfortran/generated/pack_c4.c
+++ b/libgfortran/generated/pack_c4.c
@@ -167,8 +167,8 @@ pack_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_c8.c b/libgfortran/generated/pack_c8.c
index 2ce7e2e0bba..f3478e7ce8e 100644
--- a/libgfortran/generated/pack_c8.c
+++ b/libgfortran/generated/pack_c8.c
@@ -167,8 +167,8 @@ pack_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_i1.c b/libgfortran/generated/pack_i1.c
index 4893d4a1b33..e87ef18730d 100644
--- a/libgfortran/generated/pack_i1.c
+++ b/libgfortran/generated/pack_i1.c
@@ -167,8 +167,8 @@ pack_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_i16.c b/libgfortran/generated/pack_i16.c
index 94bf7688306..d57d303ccd8 100644
--- a/libgfortran/generated/pack_i16.c
+++ b/libgfortran/generated/pack_i16.c
@@ -167,8 +167,8 @@ pack_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_i2.c b/libgfortran/generated/pack_i2.c
index e15f4cd7dcd..4059e21c9a4 100644
--- a/libgfortran/generated/pack_i2.c
+++ b/libgfortran/generated/pack_i2.c
@@ -167,8 +167,8 @@ pack_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_i4.c b/libgfortran/generated/pack_i4.c
index 808badb00fe..190095e8fbe 100644
--- a/libgfortran/generated/pack_i4.c
+++ b/libgfortran/generated/pack_i4.c
@@ -167,8 +167,8 @@ pack_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_i8.c b/libgfortran/generated/pack_i8.c
index 4297be155f2..a9d2f9d11e7 100644
--- a/libgfortran/generated/pack_i8.c
+++ b/libgfortran/generated/pack_i8.c
@@ -167,8 +167,8 @@ pack_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_r10.c b/libgfortran/generated/pack_r10.c
index 9c9d57c1489..e89c5298962 100644
--- a/libgfortran/generated/pack_r10.c
+++ b/libgfortran/generated/pack_r10.c
@@ -167,8 +167,8 @@ pack_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_r16.c b/libgfortran/generated/pack_r16.c
index 9bc76910a0f..4b3e7561526 100644
--- a/libgfortran/generated/pack_r16.c
+++ b/libgfortran/generated/pack_r16.c
@@ -167,8 +167,8 @@ pack_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_r4.c b/libgfortran/generated/pack_r4.c
index 6cf3d608e24..14e7914f68e 100644
--- a/libgfortran/generated/pack_r4.c
+++ b/libgfortran/generated/pack_r4.c
@@ -167,8 +167,8 @@ pack_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
if (total == 0)
return;
diff --git a/libgfortran/generated/pack_r8.c b/libgfortran/generated/pack_r8.c
index 623c31c6c9f..07e29f7c5b1 100644
--- a/libgfortran/generated/pack_r8.c
+++ b/libgfortran/generated/pack_r8.c
@@ -167,8 +167,8 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
if (total == 0)
return;
diff --git a/libgfortran/generated/parity_l1.c b/libgfortran/generated/parity_l1.c
index d9f0bfbc7f7..615a744b0d1 100644
--- a/libgfortran/generated/parity_l1.c
+++ b/libgfortran/generated/parity_l1.c
@@ -99,10 +99,9 @@ parity_l1 (gfc_array_l1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/parity_l16.c b/libgfortran/generated/parity_l16.c
index 2c5dec8a5ce..dd7d69a830c 100644
--- a/libgfortran/generated/parity_l16.c
+++ b/libgfortran/generated/parity_l16.c
@@ -99,10 +99,9 @@ parity_l16 (gfc_array_l16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/parity_l2.c b/libgfortran/generated/parity_l2.c
index ec1786d82fe..7a64c1891e4 100644
--- a/libgfortran/generated/parity_l2.c
+++ b/libgfortran/generated/parity_l2.c
@@ -99,10 +99,9 @@ parity_l2 (gfc_array_l2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/parity_l4.c b/libgfortran/generated/parity_l4.c
index 1604bbcc373..11e0bbf67be 100644
--- a/libgfortran/generated/parity_l4.c
+++ b/libgfortran/generated/parity_l4.c
@@ -99,10 +99,9 @@ parity_l4 (gfc_array_l4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/parity_l8.c b/libgfortran/generated/parity_l8.c
index a3a4152126d..ac131918caf 100644
--- a/libgfortran/generated/parity_l8.c
+++ b/libgfortran/generated/parity_l8.c
@@ -99,10 +99,9 @@ parity_l8 (gfc_array_l8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c
index feaba8ab546..5607dbe75cf 100644
--- a/libgfortran/generated/product_c10.c
+++ b/libgfortran/generated/product_c10.c
@@ -98,10 +98,9 @@ product_c10 (gfc_array_c10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
@@ -432,8 +430,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index 338ce75d36e..c0c972cc295 100644
--- a/libgfortran/generated/product_c16.c
+++ b/libgfortran/generated/product_c16.c
@@ -98,10 +98,9 @@ product_c16 (gfc_array_c16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
@@ -432,8 +430,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index 86fa19a38ad..b61635dd463 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -98,10 +98,9 @@ product_c4 (gfc_array_c4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
@@ -432,8 +430,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index ab043e2ec75..09d23b9be0e 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -98,10 +98,9 @@ product_c8 (gfc_array_c8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
@@ -432,8 +430,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index 8dbc761d466..23192cbea79 100644
--- a/libgfortran/generated/product_i1.c
+++ b/libgfortran/generated/product_i1.c
@@ -98,10 +98,9 @@ product_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -432,8 +430,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 3499c70ac6f..56320078ffc 100644
--- a/libgfortran/generated/product_i16.c
+++ b/libgfortran/generated/product_i16.c
@@ -98,10 +98,9 @@ product_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -432,8 +430,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index 16a547cb4c1..a0b8129a320 100644
--- a/libgfortran/generated/product_i2.c
+++ b/libgfortran/generated/product_i2.c
@@ -98,10 +98,9 @@ product_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -432,8 +430,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index b78a96f11cb..84f0d5c503f 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -98,10 +98,9 @@ product_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -432,8 +430,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index 7c5641727fa..b381eda82ab 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -98,10 +98,9 @@ product_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -432,8 +430,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index c504714185b..65229926f6e 100644
--- a/libgfortran/generated/product_r10.c
+++ b/libgfortran/generated/product_r10.c
@@ -98,10 +98,9 @@ product_r10 (gfc_array_r10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -432,8 +430,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c
index 0a95f5ab425..13891a0fccc 100644
--- a/libgfortran/generated/product_r16.c
+++ b/libgfortran/generated/product_r16.c
@@ -98,10 +98,9 @@ product_r16 (gfc_array_r16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -432,8 +430,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index d6e8740ebdd..5d9a573f01c 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -98,10 +98,9 @@ product_r4 (gfc_array_r4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -432,8 +430,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index 956fce70016..cdc3a5e9fc2 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -98,10 +98,9 @@ product_r8 (gfc_array_r8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -432,8 +430,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/libgfortran/generated/reshape_c10.c b/libgfortran/generated/reshape_c10.c
index 026c71b7e0f..45914ab8b4e 100644
--- a/libgfortran/generated/reshape_c10.c
+++ b/libgfortran/generated/reshape_c10.c
@@ -111,11 +111,11 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_c16.c b/libgfortran/generated/reshape_c16.c
index 518b2663811..517c672aab3 100644
--- a/libgfortran/generated/reshape_c16.c
+++ b/libgfortran/generated/reshape_c16.c
@@ -111,11 +111,11 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_c4.c b/libgfortran/generated/reshape_c4.c
index 352b0de164d..81f0e539d10 100644
--- a/libgfortran/generated/reshape_c4.c
+++ b/libgfortran/generated/reshape_c4.c
@@ -111,11 +111,11 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_c8.c b/libgfortran/generated/reshape_c8.c
index 9a2e180b64b..d91dcae432b 100644
--- a/libgfortran/generated/reshape_c8.c
+++ b/libgfortran/generated/reshape_c8.c
@@ -111,11 +111,11 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_i16.c b/libgfortran/generated/reshape_i16.c
index d7c3457c83f..b43a841b7c9 100644
--- a/libgfortran/generated/reshape_i16.c
+++ b/libgfortran/generated/reshape_i16.c
@@ -111,11 +111,11 @@ reshape_16 (gfc_array_i16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c
index 8d26e1847d2..01f5b34b1e3 100644
--- a/libgfortran/generated/reshape_i4.c
+++ b/libgfortran/generated/reshape_i4.c
@@ -111,11 +111,11 @@ reshape_4 (gfc_array_i4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_i8.c b/libgfortran/generated/reshape_i8.c
index c91eee0eb94..63ecd497926 100644
--- a/libgfortran/generated/reshape_i8.c
+++ b/libgfortran/generated/reshape_i8.c
@@ -111,11 +111,11 @@ reshape_8 (gfc_array_i8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_r10.c b/libgfortran/generated/reshape_r10.c
index c3e750d2bf7..2f1a552c50c 100644
--- a/libgfortran/generated/reshape_r10.c
+++ b/libgfortran/generated/reshape_r10.c
@@ -111,11 +111,11 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_r16.c b/libgfortran/generated/reshape_r16.c
index 30454a6e6c1..31d8a0756c7 100644
--- a/libgfortran/generated/reshape_r16.c
+++ b/libgfortran/generated/reshape_r16.c
@@ -111,11 +111,11 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_r4.c b/libgfortran/generated/reshape_r4.c
index 225e941a0ff..8db329ba870 100644
--- a/libgfortran/generated/reshape_r4.c
+++ b/libgfortran/generated/reshape_r4.c
@@ -111,11 +111,11 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c
index ebbbcbea56d..33b476830d7 100644
--- a/libgfortran/generated/reshape_r8.c
+++ b/libgfortran/generated/reshape_r8.c
@@ -111,11 +111,11 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
ret->elem_len = source->elem_len;
ret->type = source->type;
}
diff --git a/libgfortran/generated/shape_i16.c b/libgfortran/generated/shape_i16.c
index a73b9b533b7..ccf3484fdb6 100644
--- a/libgfortran/generated/shape_i16.c
+++ b/libgfortran/generated/shape_i16.c
@@ -49,7 +49,7 @@ shape_16 (gfc_array_i16 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank, sizeof (GFC_INTEGER_16));
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
stride = GFC_DESCRIPTOR_STRIDE_TYPEKNOWN(ret,0);
diff --git a/libgfortran/generated/shape_i4.c b/libgfortran/generated/shape_i4.c
index b53f353d66c..1af330c7a1a 100644
--- a/libgfortran/generated/shape_i4.c
+++ b/libgfortran/generated/shape_i4.c
@@ -49,7 +49,7 @@ shape_4 (gfc_array_i4 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank, sizeof (GFC_INTEGER_4));
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
stride = GFC_DESCRIPTOR_STRIDE_TYPEKNOWN(ret,0);
diff --git a/libgfortran/generated/shape_i8.c b/libgfortran/generated/shape_i8.c
index 7b4dac61d9e..bec047d2e73 100644
--- a/libgfortran/generated/shape_i8.c
+++ b/libgfortran/generated/shape_i8.c
@@ -49,7 +49,7 @@ shape_8 (gfc_array_i8 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank, sizeof (GFC_INTEGER_8));
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
stride = GFC_DESCRIPTOR_STRIDE_TYPEKNOWN(ret,0);
diff --git a/libgfortran/generated/spread_c10.c b/libgfortran/generated/spread_c10.c
index 40c37f67c8f..ce9940ac14d 100644
--- a/libgfortran/generated/spread_c10.c
+++ b/libgfortran/generated/spread_c10.c
@@ -102,8 +102,8 @@ spread_c10 (gfc_array_c10 *ret, const gfc_array_c10 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_COMPLEX_10));
}
diff --git a/libgfortran/generated/spread_c16.c b/libgfortran/generated/spread_c16.c
index a8f344be752..4ed122ff25f 100644
--- a/libgfortran/generated/spread_c16.c
+++ b/libgfortran/generated/spread_c16.c
@@ -102,8 +102,8 @@ spread_c16 (gfc_array_c16 *ret, const gfc_array_c16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_COMPLEX_16));
}
diff --git a/libgfortran/generated/spread_c4.c b/libgfortran/generated/spread_c4.c
index 38a6a75e68d..67a672a17a8 100644
--- a/libgfortran/generated/spread_c4.c
+++ b/libgfortran/generated/spread_c4.c
@@ -102,8 +102,8 @@ spread_c4 (gfc_array_c4 *ret, const gfc_array_c4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_COMPLEX_4));
}
diff --git a/libgfortran/generated/spread_c8.c b/libgfortran/generated/spread_c8.c
index 17e1cd563b4..b01627e53be 100644
--- a/libgfortran/generated/spread_c8.c
+++ b/libgfortran/generated/spread_c8.c
@@ -102,8 +102,8 @@ spread_c8 (gfc_array_c8 *ret, const gfc_array_c8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_COMPLEX_8));
}
diff --git a/libgfortran/generated/spread_i1.c b/libgfortran/generated/spread_i1.c
index 74375977fc3..875b8864eea 100644
--- a/libgfortran/generated/spread_i1.c
+++ b/libgfortran/generated/spread_i1.c
@@ -102,8 +102,8 @@ spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_INTEGER_1));
}
diff --git a/libgfortran/generated/spread_i16.c b/libgfortran/generated/spread_i16.c
index 3be8937ce88..3690ceb2a4f 100644
--- a/libgfortran/generated/spread_i16.c
+++ b/libgfortran/generated/spread_i16.c
@@ -102,8 +102,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_INTEGER_16));
}
diff --git a/libgfortran/generated/spread_i2.c b/libgfortran/generated/spread_i2.c
index 55288a40226..3f2f9ecbb30 100644
--- a/libgfortran/generated/spread_i2.c
+++ b/libgfortran/generated/spread_i2.c
@@ -102,8 +102,8 @@ spread_i2 (gfc_array_i2 *ret, const gfc_array_i2 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_INTEGER_2));
}
diff --git a/libgfortran/generated/spread_i4.c b/libgfortran/generated/spread_i4.c
index ea7e18d655e..92655d50b16 100644
--- a/libgfortran/generated/spread_i4.c
+++ b/libgfortran/generated/spread_i4.c
@@ -102,8 +102,8 @@ spread_i4 (gfc_array_i4 *ret, const gfc_array_i4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_INTEGER_4));
}
diff --git a/libgfortran/generated/spread_i8.c b/libgfortran/generated/spread_i8.c
index 0b2e1a0bf8b..30f10d967f4 100644
--- a/libgfortran/generated/spread_i8.c
+++ b/libgfortran/generated/spread_i8.c
@@ -102,8 +102,8 @@ spread_i8 (gfc_array_i8 *ret, const gfc_array_i8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_INTEGER_8));
}
diff --git a/libgfortran/generated/spread_r10.c b/libgfortran/generated/spread_r10.c
index 98cfd2022c8..8f59d131a5e 100644
--- a/libgfortran/generated/spread_r10.c
+++ b/libgfortran/generated/spread_r10.c
@@ -102,8 +102,8 @@ spread_r10 (gfc_array_r10 *ret, const gfc_array_r10 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_REAL_10));
}
diff --git a/libgfortran/generated/spread_r16.c b/libgfortran/generated/spread_r16.c
index a30dcdda42c..4a1a35e0f24 100644
--- a/libgfortran/generated/spread_r16.c
+++ b/libgfortran/generated/spread_r16.c
@@ -102,8 +102,8 @@ spread_r16 (gfc_array_r16 *ret, const gfc_array_r16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_REAL_16));
}
diff --git a/libgfortran/generated/spread_r4.c b/libgfortran/generated/spread_r4.c
index faa619e882b..a3f9b48a693 100644
--- a/libgfortran/generated/spread_r4.c
+++ b/libgfortran/generated/spread_r4.c
@@ -102,8 +102,8 @@ spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_REAL_4));
}
diff --git a/libgfortran/generated/spread_r8.c b/libgfortran/generated/spread_r8.c
index ece719cd56e..754bc40d2fc 100644
--- a/libgfortran/generated/spread_r8.c
+++ b/libgfortran/generated/spread_r8.c
@@ -102,8 +102,8 @@ spread_r8 (gfc_array_r8 *ret, const gfc_array_r8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_REAL_8));
}
diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c
index 46fa5539b8f..cebcc78b451 100644
--- a/libgfortran/generated/sum_c10.c
+++ b/libgfortran/generated/sum_c10.c
@@ -98,10 +98,9 @@ sum_c10 (gfc_array_c10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
@@ -432,8 +430,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index 2c16e279fde..b913d926c33 100644
--- a/libgfortran/generated/sum_c16.c
+++ b/libgfortran/generated/sum_c16.c
@@ -98,10 +98,9 @@ sum_c16 (gfc_array_c16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
@@ -432,8 +430,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index 9ba84b5a56d..2e2eac0dd2b 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -98,10 +98,9 @@ sum_c4 (gfc_array_c4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
@@ -432,8 +430,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index 206467b2e39..150604d7777 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -98,10 +98,9 @@ sum_c8 (gfc_array_c8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
@@ -432,8 +430,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index dc92164e807..050763281fb 100644
--- a/libgfortran/generated/sum_i1.c
+++ b/libgfortran/generated/sum_i1.c
@@ -98,10 +98,9 @@ sum_i1 (gfc_array_i1 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -432,8 +430,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 7c70d68a9e9..ea5730edc5a 100644
--- a/libgfortran/generated/sum_i16.c
+++ b/libgfortran/generated/sum_i16.c
@@ -98,10 +98,9 @@ sum_i16 (gfc_array_i16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -432,8 +430,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index 060b1c27ead..39f82f003d0 100644
--- a/libgfortran/generated/sum_i2.c
+++ b/libgfortran/generated/sum_i2.c
@@ -98,10 +98,9 @@ sum_i2 (gfc_array_i2 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -432,8 +430,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index 7551b2afc20..dc195f8da19 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -98,10 +98,9 @@ sum_i4 (gfc_array_i4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -432,8 +430,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index 0f344aea9d7..76e44858dec 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -98,10 +98,9 @@ sum_i8 (gfc_array_i8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -432,8 +430,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 6557d67fa35..7d7d7d088a8 100644
--- a/libgfortran/generated/sum_r10.c
+++ b/libgfortran/generated/sum_r10.c
@@ -98,10 +98,9 @@ sum_r10 (gfc_array_r10 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -432,8 +430,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c
index d0c826b448b..1e591481d4e 100644
--- a/libgfortran/generated/sum_r16.c
+++ b/libgfortran/generated/sum_r16.c
@@ -98,10 +98,9 @@ sum_r16 (gfc_array_r16 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -432,8 +430,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index 8c700f184ae..f601117a739 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -98,10 +98,9 @@ sum_r4 (gfc_array_r4 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -432,8 +430,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index a2a6c3c5d53..98b43d1719f 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -98,10 +98,9 @@ sum_r8 (gfc_array_r8 * const restrict retarray,
retarray->elem_len = array->elem_len;
retarray->type = array->type;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -273,8 +272,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->elem_len = array->elem_len;
@@ -287,7 +285,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -432,8 +430,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray,
retarray->type = array->type;
retarray->offset = 0;
- alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_SM (retarray, rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -442,7 +439,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/libgfortran/generated/transpose_c10.c b/libgfortran/generated/transpose_c10.c
index 2d9c84c9893..e746cef0e96 100644
--- a/libgfortran/generated/transpose_c10.c
+++ b/libgfortran/generated/transpose_c10.c
@@ -60,7 +60,8 @@ transpose_c10 (gfc_array_c10 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_COMPLEX_10));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_10));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_c16.c b/libgfortran/generated/transpose_c16.c
index 99f963746aa..bd11080ce32 100644
--- a/libgfortran/generated/transpose_c16.c
+++ b/libgfortran/generated/transpose_c16.c
@@ -60,7 +60,8 @@ transpose_c16 (gfc_array_c16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_COMPLEX_16));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_c4.c b/libgfortran/generated/transpose_c4.c
index 6722b364914..edd62b3a63f 100644
--- a/libgfortran/generated/transpose_c4.c
+++ b/libgfortran/generated/transpose_c4.c
@@ -60,7 +60,8 @@ transpose_c4 (gfc_array_c4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_COMPLEX_4));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_c8.c b/libgfortran/generated/transpose_c8.c
index 422c6da41c3..014a9ef3298 100644
--- a/libgfortran/generated/transpose_c8.c
+++ b/libgfortran/generated/transpose_c8.c
@@ -60,7 +60,8 @@ transpose_c8 (gfc_array_c8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_COMPLEX_8));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_i16.c b/libgfortran/generated/transpose_i16.c
index 7993c20b5ca..76941458a39 100644
--- a/libgfortran/generated/transpose_i16.c
+++ b/libgfortran/generated/transpose_i16.c
@@ -60,7 +60,8 @@ transpose_i16 (gfc_array_i16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_INTEGER_16));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_i4.c b/libgfortran/generated/transpose_i4.c
index 395586b2bc4..0eb2ea414d2 100644
--- a/libgfortran/generated/transpose_i4.c
+++ b/libgfortran/generated/transpose_i4.c
@@ -60,7 +60,8 @@ transpose_i4 (gfc_array_i4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_INTEGER_4));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_i8.c b/libgfortran/generated/transpose_i8.c
index c8042723969..7a77e329d9b 100644
--- a/libgfortran/generated/transpose_i8.c
+++ b/libgfortran/generated/transpose_i8.c
@@ -60,7 +60,8 @@ transpose_i8 (gfc_array_i8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_INTEGER_8));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_r10.c b/libgfortran/generated/transpose_r10.c
index fa44c38d913..b1232984054 100644
--- a/libgfortran/generated/transpose_r10.c
+++ b/libgfortran/generated/transpose_r10.c
@@ -60,7 +60,8 @@ transpose_r10 (gfc_array_r10 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_REAL_10));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_10));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_r16.c b/libgfortran/generated/transpose_r16.c
index 88036309090..fb853c2a2c7 100644
--- a/libgfortran/generated/transpose_r16.c
+++ b/libgfortran/generated/transpose_r16.c
@@ -60,7 +60,8 @@ transpose_r16 (gfc_array_r16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_REAL_16));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_r4.c b/libgfortran/generated/transpose_r4.c
index a7026071748..98bad752bf2 100644
--- a/libgfortran/generated/transpose_r4.c
+++ b/libgfortran/generated/transpose_r4.c
@@ -60,7 +60,8 @@ transpose_r4 (gfc_array_r4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_REAL_4));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/transpose_r8.c b/libgfortran/generated/transpose_r8.c
index bc1ff3d2c85..17926bddab7 100644
--- a/libgfortran/generated/transpose_r8.c
+++ b/libgfortran/generated/transpose_r8.c
@@ -60,7 +60,8 @@ transpose_r8 (gfc_array_r8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0),
GFC_DESCRIPTOR_EXTENT(source, 1)*sizeof (GFC_REAL_8));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/libgfortran/generated/unpack_c10.c b/libgfortran/generated/unpack_c10.c
index 9dc24896691..57a53f1a6f7 100644
--- a/libgfortran/generated/unpack_c10.c
+++ b/libgfortran/generated/unpack_c10.c
@@ -100,7 +100,7 @@ unpack0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
}
else
{
@@ -246,7 +246,7 @@ unpack1_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/libgfortran/generated/unpack_c16.c b/libgfortran/generated/unpack_c16.c
index e3c465319e5..1e6e1cf7652 100644
--- a/libgfortran/generated/unpack_c16.c
+++ b/libgfortran/generated/unpack_c16.c
@@ -100,7 +100,7 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{
@@ -246,7 +246,7 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/libgfortran/generated/unpack_c4.c b/libgfortran/generated/unpack_c4.c
index c8f47ec322a..4bfe5f750ee 100644
--- a/libgfortran/generated/unpack_c4.c
+++ b/libgfortran/generated/unpack_c4.c
@@ -100,7 +100,7 @@ unpack0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
}
else
{
@@ -246,7 +246,7 @@ unpack1_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/libgfortran/generated/unpack_c8.c b/libgfortran/generated/unpack_c8.c
index 694ce7bd117..4800498767e 100644
--- a/libgfortran/generated/unpack_c8.c
+++ b/libgfortran/generated/unpack_c8.c
@@ -100,7 +100,7 @@ unpack0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
}
else
{
@@ -246,7 +246,7 @@ unpack1_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/libgfortran/generated/unpack_i1.c b/libgfortran/generated/unpack_i1.c
index ed473b30e36..51101e0ddf0 100644
--- a/libgfortran/generated/unpack_i1.c
+++ b/libgfortran/generated/unpack_i1.c
@@ -100,7 +100,7 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
}
else
{
@@ -246,7 +246,7 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/libgfortran/generated/unpack_i16.c b/libgfortran/generated/unpack_i16.c
index 01140f467d1..feaed3dec65 100644
--- a/libgfortran/generated/unpack_i16.c
+++ b/libgfortran/generated/unpack_i16.c
@@ -100,7 +100,7 @@ unpack0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
}
else
{
@@ -246,7 +246,7 @@ unpack1_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/libgfortran/generated/unpack_i2.c b/libgfortran/generated/unpack_i2.c
index 55364d5a523..45e0aa0cb55 100644
--- a/libgfortran/generated/unpack_i2.c
+++ b/libgfortran/generated/unpack_i2.c
@@ -100,7 +100,7 @@ unpack0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
}
else
{
@@ -246,7 +246,7 @@ unpack1_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/libgfortran/generated/unpack_i4.c b/libgfortran/generated/unpack_i4.c
index b872b50cd45..c58287ae037 100644
--- a/libgfortran/generated/unpack_i4.c
+++ b/libgfortran/generated/unpack_i4.c
@@ -100,7 +100,7 @@ unpack0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
}
else
{
@@ -246,7 +246,7 @@ unpack1_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/libgfortran/generated/unpack_i8.c b/libgfortran/generated/unpack_i8.c
index 5baf10ea533..3c1c1afe695 100644
--- a/libgfortran/generated/unpack_i8.c
+++ b/libgfortran/generated/unpack_i8.c
@@ -100,7 +100,7 @@ unpack0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
}
else
{
@@ -246,7 +246,7 @@ unpack1_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/libgfortran/generated/unpack_r10.c b/libgfortran/generated/unpack_r10.c
index 781990d5f77..e2737a625f3 100644
--- a/libgfortran/generated/unpack_r10.c
+++ b/libgfortran/generated/unpack_r10.c
@@ -100,7 +100,7 @@ unpack0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
}
else
{
@@ -246,7 +246,7 @@ unpack1_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
}
else
{
diff --git a/libgfortran/generated/unpack_r16.c b/libgfortran/generated/unpack_r16.c
index 5a7ca6f3f04..8ce95c800a5 100644
--- a/libgfortran/generated/unpack_r16.c
+++ b/libgfortran/generated/unpack_r16.c
@@ -100,7 +100,7 @@ unpack0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
}
else
{
@@ -246,7 +246,7 @@ unpack1_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
}
else
{
diff --git a/libgfortran/generated/unpack_r4.c b/libgfortran/generated/unpack_r4.c
index 22e0a09ace4..2e977ad466c 100644
--- a/libgfortran/generated/unpack_r4.c
+++ b/libgfortran/generated/unpack_r4.c
@@ -100,7 +100,7 @@ unpack0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
}
else
{
@@ -246,7 +246,7 @@ unpack1_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
}
else
{
diff --git a/libgfortran/generated/unpack_r8.c b/libgfortran/generated/unpack_r8.c
index dcff04bb941..249f6654e49 100644
--- a/libgfortran/generated/unpack_r8.c
+++ b/libgfortran/generated/unpack_r8.c
@@ -100,7 +100,7 @@ unpack0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
}
else
{
@@ -246,7 +246,7 @@ unpack1_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
}
else
{