diff options
author | Rong Xu <xur@google.com> | 2014-08-06 17:50:42 -0700 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2014-08-06 17:50:42 -0700 |
commit | f1c18afafc2b321465ae6b07ede127095942d7dc (patch) | |
tree | 812093eebfa8510367718c12c02f7da03c0e73bf /gcc-4.9/libgfortran | |
parent | 38a8aecfb882072900434499696b5c32a2274515 (diff) | |
download | toolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.tar.gz toolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.tar.bz2 toolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.zip |
[gcc-4.9] Merge svn r213650 from google/gcc-4_9 branch
Merge svn r213650 from google/gcc-4_9 branch. Tested with
arm,x86,mips,arm64,x86_64,mips64 build in liunux/windows.
Change-Id: I0c07f67d516074172aa393003eee664d01f2e0f2
Diffstat (limited to 'gcc-4.9/libgfortran')
332 files changed, 1244 insertions, 1511 deletions
diff --git a/gcc-4.9/libgfortran/ChangeLog b/gcc-4.9/libgfortran/ChangeLog index 2d19304d5..89f2c8a10 100644 --- a/gcc-4.9/libgfortran/ChangeLog +++ b/gcc-4.9/libgfortran/ChangeLog @@ -1,3 +1,61 @@ +2014-07-31 Janne Blomqvist <jb@gcc.gnu.org> + + Backport from mainline + CVE-2014-5044 + * libgfortran.h (xmallocarray): New prototype. + * runtime/memory.c (xmallocarray): New function. + (xcalloc): Check for nonzero separately instead of multiplying. + * generated/*.c: Regenerated. + * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of + xmalloc. + * intrinsics/eoshift0.c (eoshift0): Likewise. + * intrinsics/eoshift2.c (eoshift2): Likewise. + * intrinsics/pack_generic.c (pack_internal): Likewise. + (pack_s_internal): Likewise. + * intrinsics/reshape_generic.c (reshape_internal): Likewise. + * intrinsics/spread_generic.c (spread_internal): Likewise. + (spread_internal_scalar): Likewise. + * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. + (string_minmax): Likewise. + * intrinsics/transpose_generic.c (transpose_internal): Likewise. + * intrinsics/unpack_generic.c (unpack_internal): Likewise. + * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. + * io/transfer.c (st_set_nml_var): Call xmallocarray instead of + xmalloc. + * io/unit.c (get_internal_unit): Likewise. + (filename_from_unit): Don't cast xmalloc return value. + * io/write.c (nml_write_obj): Likewise, formatting. + * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray + instead of xmalloc. + (besse_yn_r'rtype_kind`): Likewise. + * m4/cshift1.m4 (cshift1): Likewise. + * m4/eoshift1.m4 (eoshift1): Likewise. + * m4/eoshift3.m4 (eoshift3): Likewise. + * m4/iforeach.m4: Likewise. + * m4/ifunction.m4: Likewise. + * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): + Likewise. + * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. + * m4/matmul.m4 (matmul_'rtype_code`): Likewise. + * m4/matmull.m4 (matmul_'rtype_code`): Likewise. + * m4/pack.m4 (pack_'rtype_code`): Likewise. + * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. + * m4/shape.m4 (shape_'rtype_kind`): Likewise. + * m4/spread.m4 (spread_'rtype_code`): Likewise. + (spread_scalar_'rtype_code`): Likewise. + * m4/transpose.m4 (transpose_'rtype_code`): Likewise. + * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. + (unpack1_'rtype_code`): Likewise. + * runtime/convert_char.c (convert_char1_to_char4): Likewise. + (convert_char4_to_char1): Simplify. + * runtime/environ.c (init_unformatted): Call xmallocarray instead + of xmalloc. + * runtime/in_pack_generic.c (internal_pack): Likewise. + +2014-07-16 Release Manager + + * GCC 4.9.1 released. + 2014-07-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> Backport from trunk. diff --git a/gcc-4.9/libgfortran/generated/all_l1.c b/gcc-4.9/libgfortran/generated/all_l1.c index ed956227c..0f008b97d 100644 --- a/gcc-4.9/libgfortran/generated/all_l1.c +++ b/gcc-4.9/libgfortran/generated/all_l1.c @@ -101,8 +101,7 @@ all_l1 (gfc_array_l1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/all_l16.c b/gcc-4.9/libgfortran/generated/all_l16.c index a23001b56..a9f85b4bf 100644 --- a/gcc-4.9/libgfortran/generated/all_l16.c +++ b/gcc-4.9/libgfortran/generated/all_l16.c @@ -101,8 +101,7 @@ all_l16 (gfc_array_l16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/all_l2.c b/gcc-4.9/libgfortran/generated/all_l2.c index 28235d6db..3ef4a1dc2 100644 --- a/gcc-4.9/libgfortran/generated/all_l2.c +++ b/gcc-4.9/libgfortran/generated/all_l2.c @@ -101,8 +101,7 @@ all_l2 (gfc_array_l2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/all_l4.c b/gcc-4.9/libgfortran/generated/all_l4.c index 601b7c397..58dab4f12 100644 --- a/gcc-4.9/libgfortran/generated/all_l4.c +++ b/gcc-4.9/libgfortran/generated/all_l4.c @@ -101,8 +101,7 @@ all_l4 (gfc_array_l4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/all_l8.c b/gcc-4.9/libgfortran/generated/all_l8.c index f0041dcdd..4293aaa06 100644 --- a/gcc-4.9/libgfortran/generated/all_l8.c +++ b/gcc-4.9/libgfortran/generated/all_l8.c @@ -101,8 +101,7 @@ all_l8 (gfc_array_l8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/any_l1.c b/gcc-4.9/libgfortran/generated/any_l1.c index b94c84735..46387fdd2 100644 --- a/gcc-4.9/libgfortran/generated/any_l1.c +++ b/gcc-4.9/libgfortran/generated/any_l1.c @@ -101,8 +101,7 @@ any_l1 (gfc_array_l1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/any_l16.c b/gcc-4.9/libgfortran/generated/any_l16.c index a82135267..b29fdd923 100644 --- a/gcc-4.9/libgfortran/generated/any_l16.c +++ b/gcc-4.9/libgfortran/generated/any_l16.c @@ -101,8 +101,7 @@ any_l16 (gfc_array_l16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/any_l2.c b/gcc-4.9/libgfortran/generated/any_l2.c index 7f4eabc36..a63c593d4 100644 --- a/gcc-4.9/libgfortran/generated/any_l2.c +++ b/gcc-4.9/libgfortran/generated/any_l2.c @@ -101,8 +101,7 @@ any_l2 (gfc_array_l2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/any_l4.c b/gcc-4.9/libgfortran/generated/any_l4.c index 8ec451a8f..ccd35d789 100644 --- a/gcc-4.9/libgfortran/generated/any_l4.c +++ b/gcc-4.9/libgfortran/generated/any_l4.c @@ -101,8 +101,7 @@ any_l4 (gfc_array_l4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/any_l8.c b/gcc-4.9/libgfortran/generated/any_l8.c index 47957a77d..e089ea8be 100644 --- a/gcc-4.9/libgfortran/generated/any_l8.c +++ b/gcc-4.9/libgfortran/generated/any_l8.c @@ -101,8 +101,7 @@ any_l8 (gfc_array_l8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/bessel_r10.c b/gcc-4.9/libgfortran/generated/bessel_r10.c index 980bf8426..14b93e910 100644 --- a/gcc-4.9/libgfortran/generated/bessel_r10.c +++ b/gcc-4.9/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-1, 1); - 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-1, 1); - ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size); + ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10)); ret->offset = 0; } diff --git a/gcc-4.9/libgfortran/generated/bessel_r16.c b/gcc-4.9/libgfortran/generated/bessel_r16.c index d5757c9a6..d64fa9c13 100644 --- a/gcc-4.9/libgfortran/generated/bessel_r16.c +++ b/gcc-4.9/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-1, 1); - 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-1, 1); - ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size); + ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16)); ret->offset = 0; } diff --git a/gcc-4.9/libgfortran/generated/bessel_r4.c b/gcc-4.9/libgfortran/generated/bessel_r4.c index 6b6129f01..a86bb5fa9 100644 --- a/gcc-4.9/libgfortran/generated/bessel_r4.c +++ b/gcc-4.9/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-1, 1); - 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-1, 1); - ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size); + ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4)); ret->offset = 0; } diff --git a/gcc-4.9/libgfortran/generated/bessel_r8.c b/gcc-4.9/libgfortran/generated/bessel_r8.c index a80a7662f..84018872e 100644 --- a/gcc-4.9/libgfortran/generated/bessel_r8.c +++ b/gcc-4.9/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-1, 1); - 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-1, 1); - ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size); + ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8)); ret->offset = 0; } diff --git a/gcc-4.9/libgfortran/generated/count_16_l.c b/gcc-4.9/libgfortran/generated/count_16_l.c index f690236bc..c6c0b5b9c 100644 --- a/gcc-4.9/libgfortran/generated/count_16_l.c +++ b/gcc-4.9/libgfortran/generated/count_16_l.c @@ -101,8 +101,7 @@ count_16_l (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/count_1_l.c b/gcc-4.9/libgfortran/generated/count_1_l.c index 359a2f9ef..15d270d04 100644 --- a/gcc-4.9/libgfortran/generated/count_1_l.c +++ b/gcc-4.9/libgfortran/generated/count_1_l.c @@ -101,8 +101,7 @@ count_1_l (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/count_2_l.c b/gcc-4.9/libgfortran/generated/count_2_l.c index 0dd51a178..fd9b3d37a 100644 --- a/gcc-4.9/libgfortran/generated/count_2_l.c +++ b/gcc-4.9/libgfortran/generated/count_2_l.c @@ -101,8 +101,7 @@ count_2_l (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/count_4_l.c b/gcc-4.9/libgfortran/generated/count_4_l.c index 7879ce849..1e15256ca 100644 --- a/gcc-4.9/libgfortran/generated/count_4_l.c +++ b/gcc-4.9/libgfortran/generated/count_4_l.c @@ -101,8 +101,7 @@ count_4_l (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/count_8_l.c b/gcc-4.9/libgfortran/generated/count_8_l.c index 21516f5ff..97962a4fe 100644 --- a/gcc-4.9/libgfortran/generated/count_8_l.c +++ b/gcc-4.9/libgfortran/generated/count_8_l.c @@ -101,8 +101,7 @@ count_8_l (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/cshift1_16.c b/gcc-4.9/libgfortran/generated/cshift1_16.c index 77fc3bf36..b0cc767ae 100644 --- a/gcc-4.9/libgfortran/generated/cshift1_16.c +++ b/gcc-4.9/libgfortran/generated/cshift1_16.c @@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret, { int i; - ret->base_addr = xmalloc (size * arraysize); + ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) diff --git a/gcc-4.9/libgfortran/generated/cshift1_4.c b/gcc-4.9/libgfortran/generated/cshift1_4.c index 8accb4c82..5ea8a6ace 100644 --- a/gcc-4.9/libgfortran/generated/cshift1_4.c +++ b/gcc-4.9/libgfortran/generated/cshift1_4.c @@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret, { int i; - ret->base_addr = xmalloc (size * arraysize); + ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) diff --git a/gcc-4.9/libgfortran/generated/cshift1_8.c b/gcc-4.9/libgfortran/generated/cshift1_8.c index 6c809a995..5c4dbc360 100644 --- a/gcc-4.9/libgfortran/generated/cshift1_8.c +++ b/gcc-4.9/libgfortran/generated/cshift1_8.c @@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret, { int i; - ret->base_addr = xmalloc (size * arraysize); + ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) diff --git a/gcc-4.9/libgfortran/generated/eoshift1_16.c b/gcc-4.9/libgfortran/generated/eoshift1_16.c index 188589ff7..566d807b3 100644 --- a/gcc-4.9/libgfortran/generated/eoshift1_16.c +++ b/gcc-4.9/libgfortran/generated/eoshift1_16.c @@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/eoshift1_4.c b/gcc-4.9/libgfortran/generated/eoshift1_4.c index 81e855098..bd5fabad3 100644 --- a/gcc-4.9/libgfortran/generated/eoshift1_4.c +++ b/gcc-4.9/libgfortran/generated/eoshift1_4.c @@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/eoshift1_8.c b/gcc-4.9/libgfortran/generated/eoshift1_8.c index eff6f7666..814f81a81 100644 --- a/gcc-4.9/libgfortran/generated/eoshift1_8.c +++ b/gcc-4.9/libgfortran/generated/eoshift1_8.c @@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/eoshift3_16.c b/gcc-4.9/libgfortran/generated/eoshift3_16.c index fc5203d6e..5e09df22e 100644 --- a/gcc-4.9/libgfortran/generated/eoshift3_16.c +++ b/gcc-4.9/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->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/eoshift3_4.c b/gcc-4.9/libgfortran/generated/eoshift3_4.c index ee2b568a4..970402c63 100644 --- a/gcc-4.9/libgfortran/generated/eoshift3_4.c +++ b/gcc-4.9/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->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/eoshift3_8.c b/gcc-4.9/libgfortran/generated/eoshift3_8.c index b2e6d26cc..991eb9151 100644 --- a/gcc-4.9/libgfortran/generated/eoshift3_8.c +++ b/gcc-4.9/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->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/generated/iall_i1.c b/gcc-4.9/libgfortran/generated/iall_i1.c index ac36bac13..da0ce4d22 100644 --- a/gcc-4.9/libgfortran/generated/iall_i1.c +++ b/gcc-4.9/libgfortran/generated/iall_i1.c @@ -97,10 +97,9 @@ iall_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iall_i16.c b/gcc-4.9/libgfortran/generated/iall_i16.c index de333617a..a3f39d3c9 100644 --- a/gcc-4.9/libgfortran/generated/iall_i16.c +++ b/gcc-4.9/libgfortran/generated/iall_i16.c @@ -97,10 +97,9 @@ iall_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iall_i2.c b/gcc-4.9/libgfortran/generated/iall_i2.c index a34703686..4ca06a8a0 100644 --- a/gcc-4.9/libgfortran/generated/iall_i2.c +++ b/gcc-4.9/libgfortran/generated/iall_i2.c @@ -97,10 +97,9 @@ iall_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iall_i4.c b/gcc-4.9/libgfortran/generated/iall_i4.c index 55e09b876..8ff15f4ed 100644 --- a/gcc-4.9/libgfortran/generated/iall_i4.c +++ b/gcc-4.9/libgfortran/generated/iall_i4.c @@ -97,10 +97,9 @@ iall_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iall_i8.c b/gcc-4.9/libgfortran/generated/iall_i8.c index 9c7f88d21..08932d486 100644 --- a/gcc-4.9/libgfortran/generated/iall_i8.c +++ b/gcc-4.9/libgfortran/generated/iall_i8.c @@ -97,10 +97,9 @@ iall_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iany_i1.c b/gcc-4.9/libgfortran/generated/iany_i1.c index 2ce620b69..999230a11 100644 --- a/gcc-4.9/libgfortran/generated/iany_i1.c +++ b/gcc-4.9/libgfortran/generated/iany_i1.c @@ -97,10 +97,9 @@ iany_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iany_i16.c b/gcc-4.9/libgfortran/generated/iany_i16.c index 38e28d1b8..9410db45c 100644 --- a/gcc-4.9/libgfortran/generated/iany_i16.c +++ b/gcc-4.9/libgfortran/generated/iany_i16.c @@ -97,10 +97,9 @@ iany_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iany_i2.c b/gcc-4.9/libgfortran/generated/iany_i2.c index 7a4b79c93..7068bb192 100644 --- a/gcc-4.9/libgfortran/generated/iany_i2.c +++ b/gcc-4.9/libgfortran/generated/iany_i2.c @@ -97,10 +97,9 @@ iany_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iany_i4.c b/gcc-4.9/libgfortran/generated/iany_i4.c index 126c2fa62..62034cfd8 100644 --- a/gcc-4.9/libgfortran/generated/iany_i4.c +++ b/gcc-4.9/libgfortran/generated/iany_i4.c @@ -97,10 +97,9 @@ iany_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iany_i8.c b/gcc-4.9/libgfortran/generated/iany_i8.c index ee2a07f9c..f347d69f1 100644 --- a/gcc-4.9/libgfortran/generated/iany_i8.c +++ b/gcc-4.9/libgfortran/generated/iany_i8.c @@ -97,10 +97,9 @@ iany_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/in_pack_c10.c b/gcc-4.9/libgfortran/generated/in_pack_c10.c index ff3bb332e..9148af577 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_c10.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_c16.c b/gcc-4.9/libgfortran/generated/in_pack_c16.c index a3e961247..e109efc1d 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_c16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_c4.c b/gcc-4.9/libgfortran/generated/in_pack_c4.c index 2959354a8..3afdaf3a4 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_c4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_c8.c b/gcc-4.9/libgfortran/generated/in_pack_c8.c index e63ea9d29..995a3676d 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_c8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_i1.c b/gcc-4.9/libgfortran/generated/in_pack_i1.c index 2356102e3..2ee5e2837 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_i1.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_i16.c b/gcc-4.9/libgfortran/generated/in_pack_i16.c index e271a896a..ac6bb4f8a 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_i16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_i2.c b/gcc-4.9/libgfortran/generated/in_pack_i2.c index 391e27d24..f42a89254 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_i2.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_i4.c b/gcc-4.9/libgfortran/generated/in_pack_i4.c index 6ba027743..acde25aa9 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_i4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_i8.c b/gcc-4.9/libgfortran/generated/in_pack_i8.c index 4c05043b7..5be35445c 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_i8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_r10.c b/gcc-4.9/libgfortran/generated/in_pack_r10.c index 75dec30ed..c4680d8cc 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_r10.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_r16.c b/gcc-4.9/libgfortran/generated/in_pack_r16.c index a37623a3b..ff09d1462 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_r16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_r4.c b/gcc-4.9/libgfortran/generated/in_pack_r4.c index 5a28ff07c..34fe5829a 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_r4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/in_pack_r8.c b/gcc-4.9/libgfortran/generated/in_pack_r8.c index 7c4fa428b..b0728c9b6 100644 --- a/gcc-4.9/libgfortran/generated/in_pack_r8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/iparity_i1.c b/gcc-4.9/libgfortran/generated/iparity_i1.c index 9ccbd55de..fdccc3d44 100644 --- a/gcc-4.9/libgfortran/generated/iparity_i1.c +++ b/gcc-4.9/libgfortran/generated/iparity_i1.c @@ -97,10 +97,9 @@ iparity_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iparity_i16.c b/gcc-4.9/libgfortran/generated/iparity_i16.c index 6a4d03277..7a572ba71 100644 --- a/gcc-4.9/libgfortran/generated/iparity_i16.c +++ b/gcc-4.9/libgfortran/generated/iparity_i16.c @@ -97,10 +97,9 @@ iparity_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iparity_i2.c b/gcc-4.9/libgfortran/generated/iparity_i2.c index cb0d8a91b..49233fbc5 100644 --- a/gcc-4.9/libgfortran/generated/iparity_i2.c +++ b/gcc-4.9/libgfortran/generated/iparity_i2.c @@ -97,10 +97,9 @@ iparity_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iparity_i4.c b/gcc-4.9/libgfortran/generated/iparity_i4.c index 689f0c125..1551e51fe 100644 --- a/gcc-4.9/libgfortran/generated/iparity_i4.c +++ b/gcc-4.9/libgfortran/generated/iparity_i4.c @@ -97,10 +97,9 @@ iparity_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/iparity_i8.c b/gcc-4.9/libgfortran/generated/iparity_i8.c index de84f561a..a745bb6be 100644 --- a/gcc-4.9/libgfortran/generated/iparity_i8.c +++ b/gcc-4.9/libgfortran/generated/iparity_i8.c @@ -97,10 +97,9 @@ iparity_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/matmul_c10.c b/gcc-4.9/libgfortran/generated/matmul_c10.c index 53a8c6a9f..0ff7d58b9 100644 --- a/gcc-4.9/libgfortran/generated/matmul_c10.c +++ b/gcc-4.9/libgfortran/generated/matmul_c10.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_c16.c b/gcc-4.9/libgfortran/generated/matmul_c16.c index 00ddc1347..a5fea00c8 100644 --- a/gcc-4.9/libgfortran/generated/matmul_c16.c +++ b/gcc-4.9/libgfortran/generated/matmul_c16.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_c4.c b/gcc-4.9/libgfortran/generated/matmul_c4.c index cdb92c43d..b5b0ecb83 100644 --- a/gcc-4.9/libgfortran/generated/matmul_c4.c +++ b/gcc-4.9/libgfortran/generated/matmul_c4.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_c8.c b/gcc-4.9/libgfortran/generated/matmul_c8.c index 6a223d04f..077b709df 100644 --- a/gcc-4.9/libgfortran/generated/matmul_c8.c +++ b/gcc-4.9/libgfortran/generated/matmul_c8.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_i1.c b/gcc-4.9/libgfortran/generated/matmul_i1.c index bc24f1179..72c998a1b 100644 --- a/gcc-4.9/libgfortran/generated/matmul_i1.c +++ b/gcc-4.9/libgfortran/generated/matmul_i1.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_i16.c b/gcc-4.9/libgfortran/generated/matmul_i16.c index 74fe26221..59cd80ba8 100644 --- a/gcc-4.9/libgfortran/generated/matmul_i16.c +++ b/gcc-4.9/libgfortran/generated/matmul_i16.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_i2.c b/gcc-4.9/libgfortran/generated/matmul_i2.c index 8627361ba..6fddc4f18 100644 --- a/gcc-4.9/libgfortran/generated/matmul_i2.c +++ b/gcc-4.9/libgfortran/generated/matmul_i2.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_i4.c b/gcc-4.9/libgfortran/generated/matmul_i4.c index 37e5d5b1d..f62cb56aa 100644 --- a/gcc-4.9/libgfortran/generated/matmul_i4.c +++ b/gcc-4.9/libgfortran/generated/matmul_i4.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_i8.c b/gcc-4.9/libgfortran/generated/matmul_i8.c index 892822ae1..6d524905e 100644 --- a/gcc-4.9/libgfortran/generated/matmul_i8.c +++ b/gcc-4.9/libgfortran/generated/matmul_i8.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_l16.c b/gcc-4.9/libgfortran/generated/matmul_l16.c index bc6003009..370db0731 100644 --- a/gcc-4.9/libgfortran/generated/matmul_l16.c +++ b/gcc-4.9/libgfortran/generated/matmul_l16.c @@ -88,7 +88,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/gcc-4.9/libgfortran/generated/matmul_l4.c b/gcc-4.9/libgfortran/generated/matmul_l4.c index d464e6206..d901e3cd7 100644 --- a/gcc-4.9/libgfortran/generated/matmul_l4.c +++ b/gcc-4.9/libgfortran/generated/matmul_l4.c @@ -88,7 +88,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/gcc-4.9/libgfortran/generated/matmul_l8.c b/gcc-4.9/libgfortran/generated/matmul_l8.c index 0fd6bad01..5862c8d87 100644 --- a/gcc-4.9/libgfortran/generated/matmul_l8.c +++ b/gcc-4.9/libgfortran/generated/matmul_l8.c @@ -88,7 +88,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/gcc-4.9/libgfortran/generated/matmul_r10.c b/gcc-4.9/libgfortran/generated/matmul_r10.c index e22204470..6c9656adf 100644 --- a/gcc-4.9/libgfortran/generated/matmul_r10.c +++ b/gcc-4.9/libgfortran/generated/matmul_r10.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_r16.c b/gcc-4.9/libgfortran/generated/matmul_r16.c index 335feb074..fbe8e0928 100644 --- a/gcc-4.9/libgfortran/generated/matmul_r16.c +++ b/gcc-4.9/libgfortran/generated/matmul_r16.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_r4.c b/gcc-4.9/libgfortran/generated/matmul_r4.c index bb07efa0c..f80c8bfcd 100644 --- a/gcc-4.9/libgfortran/generated/matmul_r4.c +++ b/gcc-4.9/libgfortran/generated/matmul_r4.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/matmul_r8.c b/gcc-4.9/libgfortran/generated/matmul_r8.c index a3bc842a7..7aec3b3c2 100644 --- a/gcc-4.9/libgfortran/generated/matmul_r8.c +++ b/gcc-4.9/libgfortran/generated/matmul_r8.c @@ -124,7 +124,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/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c index 01d6e77cc..d205d2466 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c @@ -58,7 +58,7 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c index c24b4be04..3d8e3dc0f 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c @@ -58,7 +58,7 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c index 1a0f2b64b..93f5cc477 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c @@ -58,7 +58,7 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c index 005a96336..6858c8ff7 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c @@ -58,7 +58,7 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c index 2643b82dd..f324b02fc 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c @@ -58,7 +58,7 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c index 714a52343..03560f711 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c @@ -58,7 +58,7 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c index 5a2ecb304..aeb2e81d2 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c @@ -58,7 +58,7 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c index 5556429fb..a88774e95 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c @@ -58,7 +58,7 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c index 2ae92c9fc..8704cad65 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c @@ -58,7 +58,7 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c index 2470b4907..8e75ec977 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c @@ -58,7 +58,7 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c index 850a26cfa..67383b6c5 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c @@ -58,7 +58,7 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c index 89715197f..3991bd6b2 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c @@ -58,7 +58,7 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c index 9ad21d745..0a714c3c1 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c @@ -58,7 +58,7 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c index 7e1e3a46b..c32c6fb4f 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c @@ -58,7 +58,7 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c index 4d1d980ff..d2d7f2ef7 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c @@ -58,7 +58,7 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c index 0d37cdada..e9d8620f0 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c @@ -58,7 +58,7 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c index 6db50f803..c402868de 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c @@ -58,7 +58,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c index 610f757f4..5057e9c34 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c @@ -58,7 +58,7 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c index 6e1d04959..95d027dbd 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c @@ -58,7 +58,7 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c index aa2d6e39d..1fa391b11 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c @@ -58,7 +58,7 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c index b9fd82b4c..d98a1a25a 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c @@ -58,7 +58,7 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c index 36bba3e5f..56a77487f 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c @@ -58,7 +58,7 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c index e8089283c..dd1fe2c56 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c @@ -58,7 +58,7 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c index fba75b987..2c8394cef 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c @@ -58,7 +58,7 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c index 24e317ea2..4ebf6f473 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c @@ -58,7 +58,7 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c index 88dc2b230..893adadd7 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c @@ -58,7 +58,7 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c index 23c1115bf..e2343430a 100644 --- a/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c @@ -58,7 +58,7 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c index 0602fc9ef..4d1bea09c 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c @@ -98,10 +98,9 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c index 3f8c51724..eb9b2a0cd 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c @@ -98,10 +98,9 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c index f28421065..91a0800a7 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c @@ -98,10 +98,9 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c index 35fcc2a25..c68035167 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c @@ -98,10 +98,9 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c index b2c945c0b..ea164dc6b 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c @@ -98,10 +98,9 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c index d898dde14..4d5ed45a5 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c @@ -98,10 +98,9 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c index 28e2db48f..572d91617 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c @@ -98,10 +98,9 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c index f7f85a7d9..d9aef3e63 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c @@ -98,10 +98,9 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c index 69c82d373..d1014cdb0 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c @@ -98,10 +98,9 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c index fde194756..1ab44ab6b 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c @@ -98,10 +98,9 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c index c7b32b3e4..59bb2a31e 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c @@ -98,10 +98,9 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c index 2a16a0b79..794fde04d 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c @@ -98,10 +98,9 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c index 7c693e114..d10e93736 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c @@ -98,10 +98,9 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c index 45188e1d0..b761b8264 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c @@ -98,10 +98,9 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c index bd0e0f862..f1d522df5 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c @@ -98,10 +98,9 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c index 37428b295..deaf571ba 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c @@ -98,10 +98,9 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c index a42c7b447..bc6449599 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c @@ -98,10 +98,9 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c index 85b796539..af09cb3ec 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c @@ -98,10 +98,9 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c index 4c5d55ef1..caaabe72d 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c @@ -98,10 +98,9 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c index 6779d6a7b..384635c99 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c @@ -98,10 +98,9 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c index 2fe569637..731c7237e 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c @@ -98,10 +98,9 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c index ae06e9e6e..26fdf834b 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c @@ -98,10 +98,9 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c index d8d7b6836..a7f43d15f 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c @@ -98,10 +98,9 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c index 2b44cbb7b..f996db495 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c @@ -98,10 +98,9 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c index bcee80168..d3ae5cb36 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c @@ -98,10 +98,9 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c index 57a039d36..c282cf703 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c @@ -98,10 +98,9 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c index c11368098..13446e070 100644 --- a/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c +++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c @@ -98,10 +98,9 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/maxval_i1.c b/gcc-4.9/libgfortran/generated/maxval_i1.c index 18d4eff3e..eadec5ce9 100644 --- a/gcc-4.9/libgfortran/generated/maxval_i1.c +++ b/gcc-4.9/libgfortran/generated/maxval_i1.c @@ -97,10 +97,9 @@ maxval_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_i16.c b/gcc-4.9/libgfortran/generated/maxval_i16.c index 6815eb2a7..b83dd181e 100644 --- a/gcc-4.9/libgfortran/generated/maxval_i16.c +++ b/gcc-4.9/libgfortran/generated/maxval_i16.c @@ -97,10 +97,9 @@ maxval_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_i2.c b/gcc-4.9/libgfortran/generated/maxval_i2.c index 5b99b3422..72bb3b4dd 100644 --- a/gcc-4.9/libgfortran/generated/maxval_i2.c +++ b/gcc-4.9/libgfortran/generated/maxval_i2.c @@ -97,10 +97,9 @@ maxval_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_i4.c b/gcc-4.9/libgfortran/generated/maxval_i4.c index ff19f9cd3..c939a0acd 100644 --- a/gcc-4.9/libgfortran/generated/maxval_i4.c +++ b/gcc-4.9/libgfortran/generated/maxval_i4.c @@ -97,10 +97,9 @@ maxval_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_i8.c b/gcc-4.9/libgfortran/generated/maxval_i8.c index d708c3478..50ee398d2 100644 --- a/gcc-4.9/libgfortran/generated/maxval_i8.c +++ b/gcc-4.9/libgfortran/generated/maxval_i8.c @@ -97,10 +97,9 @@ maxval_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_r10.c b/gcc-4.9/libgfortran/generated/maxval_r10.c index 759198ba7..b16d26341 100644 --- a/gcc-4.9/libgfortran/generated/maxval_r10.c +++ b/gcc-4.9/libgfortran/generated/maxval_r10.c @@ -97,10 +97,9 @@ maxval_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_r16.c b/gcc-4.9/libgfortran/generated/maxval_r16.c index b16c4cb3b..df6f2b088 100644 --- a/gcc-4.9/libgfortran/generated/maxval_r16.c +++ b/gcc-4.9/libgfortran/generated/maxval_r16.c @@ -97,10 +97,9 @@ maxval_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_r4.c b/gcc-4.9/libgfortran/generated/maxval_r4.c index db688855b..edccaeb65 100644 --- a/gcc-4.9/libgfortran/generated/maxval_r4.c +++ b/gcc-4.9/libgfortran/generated/maxval_r4.c @@ -97,10 +97,9 @@ maxval_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/maxval_r8.c b/gcc-4.9/libgfortran/generated/maxval_r8.c index ea0c8d849..bfbfa981d 100644 --- a/gcc-4.9/libgfortran/generated/maxval_r8.c +++ b/gcc-4.9/libgfortran/generated/maxval_r8.c @@ -97,10 +97,9 @@ maxval_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minloc0_16_i1.c b/gcc-4.9/libgfortran/generated/minloc0_16_i1.c index f70d9fff4..ccd89f043 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_i1.c @@ -58,7 +58,7 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_i16.c b/gcc-4.9/libgfortran/generated/minloc0_16_i16.c index 796241592..65050b984 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_i16.c @@ -58,7 +58,7 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_i2.c b/gcc-4.9/libgfortran/generated/minloc0_16_i2.c index e06f9f9c6..9fb63255e 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_i2.c @@ -58,7 +58,7 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_i4.c b/gcc-4.9/libgfortran/generated/minloc0_16_i4.c index 099ac7e05..999ac4b50 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_i4.c @@ -58,7 +58,7 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_i8.c b/gcc-4.9/libgfortran/generated/minloc0_16_i8.c index 2361c8596..3c2e3c3a9 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_i8.c @@ -58,7 +58,7 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_r10.c b/gcc-4.9/libgfortran/generated/minloc0_16_r10.c index 9777ed15c..c661cdc0f 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_r10.c @@ -58,7 +58,7 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_r16.c b/gcc-4.9/libgfortran/generated/minloc0_16_r16.c index 6d3a34982..c455e92de 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_r16.c @@ -58,7 +58,7 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_r4.c b/gcc-4.9/libgfortran/generated/minloc0_16_r4.c index 6db57e841..779935e4f 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_r4.c @@ -58,7 +58,7 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_16_r8.c b/gcc-4.9/libgfortran/generated/minloc0_16_r8.c index 41e94b427..d90237677 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_16_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_16_r8.c @@ -58,7 +58,7 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -199,7 +199,7 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16)); } else { @@ -367,7 +367,7 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_i1.c b/gcc-4.9/libgfortran/generated/minloc0_4_i1.c index a2acfa9a5..a9e902dd3 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_i1.c @@ -58,7 +58,7 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_i16.c b/gcc-4.9/libgfortran/generated/minloc0_4_i16.c index 920525419..7981c28ba 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_i16.c @@ -58,7 +58,7 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_i2.c b/gcc-4.9/libgfortran/generated/minloc0_4_i2.c index 087e9245e..59439faa0 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_i2.c @@ -58,7 +58,7 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_i4.c b/gcc-4.9/libgfortran/generated/minloc0_4_i4.c index e8d43a818..5731a43ea 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_i4.c @@ -58,7 +58,7 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_i8.c b/gcc-4.9/libgfortran/generated/minloc0_4_i8.c index d2c81e761..50b8e1612 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_i8.c @@ -58,7 +58,7 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_r10.c b/gcc-4.9/libgfortran/generated/minloc0_4_r10.c index 25c7c5a75..2701a859f 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_r10.c @@ -58,7 +58,7 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_r16.c b/gcc-4.9/libgfortran/generated/minloc0_4_r16.c index c41a9f39c..fca50b39e 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_r16.c @@ -58,7 +58,7 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_r4.c b/gcc-4.9/libgfortran/generated/minloc0_4_r4.c index 08f733fa3..0469a5280 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_r4.c @@ -58,7 +58,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_4_r8.c b/gcc-4.9/libgfortran/generated/minloc0_4_r8.c index 590138f1b..7be43c4af 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_4_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_4_r8.c @@ -58,7 +58,7 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -199,7 +199,7 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); } else { @@ -367,7 +367,7 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_i1.c b/gcc-4.9/libgfortran/generated/minloc0_8_i1.c index 2bce39453..60bfe811c 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_i1.c @@ -58,7 +58,7 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_i16.c b/gcc-4.9/libgfortran/generated/minloc0_8_i16.c index 32a2b5a3d..27ddd4f99 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_i16.c @@ -58,7 +58,7 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_i2.c b/gcc-4.9/libgfortran/generated/minloc0_8_i2.c index a0061d28e..38a4aa64e 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_i2.c @@ -58,7 +58,7 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_i4.c b/gcc-4.9/libgfortran/generated/minloc0_8_i4.c index 3ea2487dc..5586ea9fa 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_i4.c @@ -58,7 +58,7 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_i8.c b/gcc-4.9/libgfortran/generated/minloc0_8_i8.c index afc6d44e4..1f21d2657 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_i8.c @@ -58,7 +58,7 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_r10.c b/gcc-4.9/libgfortran/generated/minloc0_8_r10.c index 6abc03d01..df34ca333 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_r10.c @@ -58,7 +58,7 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_r16.c b/gcc-4.9/libgfortran/generated/minloc0_8_r16.c index 322951e48..d8769ec95 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_r16.c @@ -58,7 +58,7 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_r4.c b/gcc-4.9/libgfortran/generated/minloc0_8_r4.c index c9896d744..b8ab0c990 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_r4.c @@ -58,7 +58,7 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc0_8_r8.c b/gcc-4.9/libgfortran/generated/minloc0_8_r8.c index edada9004..ff67f1ed5 100644 --- a/gcc-4.9/libgfortran/generated/minloc0_8_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc0_8_r8.c @@ -58,7 +58,7 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -199,7 +199,7 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8)); } else { @@ -367,7 +367,7 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; 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/gcc-4.9/libgfortran/generated/minloc1_16_i1.c b/gcc-4.9/libgfortran/generated/minloc1_16_i1.c index d47e946f0..a9b2d96b1 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_i1.c @@ -98,10 +98,9 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_i16.c b/gcc-4.9/libgfortran/generated/minloc1_16_i16.c index aca08c0c1..1e52c2220 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_i16.c @@ -98,10 +98,9 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_i2.c b/gcc-4.9/libgfortran/generated/minloc1_16_i2.c index 27eb379e7..7617b9e32 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_i2.c @@ -98,10 +98,9 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_i4.c b/gcc-4.9/libgfortran/generated/minloc1_16_i4.c index 4a30ac1fa..9729d11bc 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_i4.c @@ -98,10 +98,9 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_i8.c b/gcc-4.9/libgfortran/generated/minloc1_16_i8.c index 4021ac228..00421b235 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_i8.c @@ -98,10 +98,9 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_r10.c b/gcc-4.9/libgfortran/generated/minloc1_16_r10.c index c8eadc34c..fb1401b95 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_r10.c @@ -98,10 +98,9 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_r16.c b/gcc-4.9/libgfortran/generated/minloc1_16_r16.c index 6aa1de836..031286809 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_r16.c @@ -98,10 +98,9 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_r4.c b/gcc-4.9/libgfortran/generated/minloc1_16_r4.c index 67e5564da..af5b67d90 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_r4.c @@ -98,10 +98,9 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_16_r8.c b/gcc-4.9/libgfortran/generated/minloc1_16_r8.c index 1fcef6c5a..dd2be3bb4 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_16_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_16_r8.c @@ -98,10 +98,9 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_i1.c b/gcc-4.9/libgfortran/generated/minloc1_4_i1.c index 863f873f7..b0bf6efba 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_i1.c @@ -98,10 +98,9 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_i16.c b/gcc-4.9/libgfortran/generated/minloc1_4_i16.c index 9a81558f4..882b4b417 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_i16.c @@ -98,10 +98,9 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_i2.c b/gcc-4.9/libgfortran/generated/minloc1_4_i2.c index 6657c9f1d..877af7a5a 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_i2.c @@ -98,10 +98,9 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_i4.c b/gcc-4.9/libgfortran/generated/minloc1_4_i4.c index 36e9552c4..3a872706d 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_i4.c @@ -98,10 +98,9 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_i8.c b/gcc-4.9/libgfortran/generated/minloc1_4_i8.c index c5d782831..22e43bf6c 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_i8.c @@ -98,10 +98,9 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_r10.c b/gcc-4.9/libgfortran/generated/minloc1_4_r10.c index f55791c01..624006cd6 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_r10.c @@ -98,10 +98,9 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_r16.c b/gcc-4.9/libgfortran/generated/minloc1_4_r16.c index 99163f439..f32b60825 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_r16.c @@ -98,10 +98,9 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_r4.c b/gcc-4.9/libgfortran/generated/minloc1_4_r4.c index 9e8574504..0ed5fe96e 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_r4.c @@ -98,10 +98,9 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_4_r8.c b/gcc-4.9/libgfortran/generated/minloc1_4_r8.c index 75f2a5ff1..c780a42aa 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_4_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_4_r8.c @@ -98,10 +98,9 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_i1.c b/gcc-4.9/libgfortran/generated/minloc1_8_i1.c index 8c065ec47..6f8c7d944 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_i1.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_i1.c @@ -98,10 +98,9 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_i16.c b/gcc-4.9/libgfortran/generated/minloc1_8_i16.c index 68c961773..07cb01171 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_i16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_i16.c @@ -98,10 +98,9 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_i2.c b/gcc-4.9/libgfortran/generated/minloc1_8_i2.c index 3e4f4f05b..9ea0bf4c3 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_i2.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_i2.c @@ -98,10 +98,9 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_i4.c b/gcc-4.9/libgfortran/generated/minloc1_8_i4.c index b0e753af2..5e433cc1d 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_i4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_i4.c @@ -98,10 +98,9 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_i8.c b/gcc-4.9/libgfortran/generated/minloc1_8_i8.c index a7fec9070..364cf3249 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_i8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_i8.c @@ -98,10 +98,9 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_r10.c b/gcc-4.9/libgfortran/generated/minloc1_8_r10.c index 6b3e80f0a..901cf91a3 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_r10.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_r10.c @@ -98,10 +98,9 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_r16.c b/gcc-4.9/libgfortran/generated/minloc1_8_r16.c index 7b69876e2..7bf17ea37 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_r16.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_r16.c @@ -98,10 +98,9 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_r4.c b/gcc-4.9/libgfortran/generated/minloc1_8_r4.c index 13d40ea9a..5edb92f99 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_r4.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_r4.c @@ -98,10 +98,9 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minloc1_8_r8.c b/gcc-4.9/libgfortran/generated/minloc1_8_r8.c index 51151f236..405b9e183 100644 --- a/gcc-4.9/libgfortran/generated/minloc1_8_r8.c +++ b/gcc-4.9/libgfortran/generated/minloc1_8_r8.c @@ -98,10 +98,9 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -294,8 +293,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -307,7 +305,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 @@ -485,8 +483,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -495,7 +492,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/gcc-4.9/libgfortran/generated/minval_i1.c b/gcc-4.9/libgfortran/generated/minval_i1.c index 261dac8e4..da7405b28 100644 --- a/gcc-4.9/libgfortran/generated/minval_i1.c +++ b/gcc-4.9/libgfortran/generated/minval_i1.c @@ -97,10 +97,9 @@ minval_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_i16.c b/gcc-4.9/libgfortran/generated/minval_i16.c index c75db9682..11cbeac5f 100644 --- a/gcc-4.9/libgfortran/generated/minval_i16.c +++ b/gcc-4.9/libgfortran/generated/minval_i16.c @@ -97,10 +97,9 @@ minval_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_i2.c b/gcc-4.9/libgfortran/generated/minval_i2.c index 5e7a3642e..e208b57e2 100644 --- a/gcc-4.9/libgfortran/generated/minval_i2.c +++ b/gcc-4.9/libgfortran/generated/minval_i2.c @@ -97,10 +97,9 @@ minval_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_i4.c b/gcc-4.9/libgfortran/generated/minval_i4.c index a8aed7dc0..68ba76e8d 100644 --- a/gcc-4.9/libgfortran/generated/minval_i4.c +++ b/gcc-4.9/libgfortran/generated/minval_i4.c @@ -97,10 +97,9 @@ minval_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_i8.c b/gcc-4.9/libgfortran/generated/minval_i8.c index 1d489bc55..b089358d0 100644 --- a/gcc-4.9/libgfortran/generated/minval_i8.c +++ b/gcc-4.9/libgfortran/generated/minval_i8.c @@ -97,10 +97,9 @@ minval_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_r10.c b/gcc-4.9/libgfortran/generated/minval_r10.c index 9181e21d7..e9e6afee6 100644 --- a/gcc-4.9/libgfortran/generated/minval_r10.c +++ b/gcc-4.9/libgfortran/generated/minval_r10.c @@ -97,10 +97,9 @@ minval_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_r16.c b/gcc-4.9/libgfortran/generated/minval_r16.c index 85aaa5dbe..e4e38275d 100644 --- a/gcc-4.9/libgfortran/generated/minval_r16.c +++ b/gcc-4.9/libgfortran/generated/minval_r16.c @@ -97,10 +97,9 @@ minval_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_r4.c b/gcc-4.9/libgfortran/generated/minval_r4.c index 19a258c81..515b2db49 100644 --- a/gcc-4.9/libgfortran/generated/minval_r4.c +++ b/gcc-4.9/libgfortran/generated/minval_r4.c @@ -97,10 +97,9 @@ minval_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/minval_r8.c b/gcc-4.9/libgfortran/generated/minval_r8.c index d2f963976..c61656f87 100644 --- a/gcc-4.9/libgfortran/generated/minval_r8.c +++ b/gcc-4.9/libgfortran/generated/minval_r8.c @@ -97,10 +97,9 @@ minval_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -286,8 +285,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -299,7 +297,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 @@ -472,8 +470,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -482,7 +479,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/gcc-4.9/libgfortran/generated/norm2_r10.c b/gcc-4.9/libgfortran/generated/norm2_r10.c index 44028ccb2..0145c99b6 100644 --- a/gcc-4.9/libgfortran/generated/norm2_r10.c +++ b/gcc-4.9/libgfortran/generated/norm2_r10.c @@ -101,10 +101,9 @@ norm2_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/norm2_r16.c b/gcc-4.9/libgfortran/generated/norm2_r16.c index c036edce8..46329d523 100644 --- a/gcc-4.9/libgfortran/generated/norm2_r16.c +++ b/gcc-4.9/libgfortran/generated/norm2_r16.c @@ -105,10 +105,9 @@ norm2_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/norm2_r4.c b/gcc-4.9/libgfortran/generated/norm2_r4.c index dcf78daf9..067dbee62 100644 --- a/gcc-4.9/libgfortran/generated/norm2_r4.c +++ b/gcc-4.9/libgfortran/generated/norm2_r4.c @@ -101,10 +101,9 @@ norm2_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/norm2_r8.c b/gcc-4.9/libgfortran/generated/norm2_r8.c index 1bda1c5e0..51c89427a 100644 --- a/gcc-4.9/libgfortran/generated/norm2_r8.c +++ b/gcc-4.9/libgfortran/generated/norm2_r8.c @@ -101,10 +101,9 @@ norm2_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/pack_c10.c b/gcc-4.9/libgfortran/generated/pack_c10.c index 9fcacf12e..90866a840 100644 --- a/gcc-4.9/libgfortran/generated/pack_c10.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_c16.c b/gcc-4.9/libgfortran/generated/pack_c16.c index 0e3db3452..60f60d1e4 100644 --- a/gcc-4.9/libgfortran/generated/pack_c16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_c4.c b/gcc-4.9/libgfortran/generated/pack_c4.c index f17d35abf..36a9f941c 100644 --- a/gcc-4.9/libgfortran/generated/pack_c4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_c8.c b/gcc-4.9/libgfortran/generated/pack_c8.c index f291b4676..38880c183 100644 --- a/gcc-4.9/libgfortran/generated/pack_c8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_i1.c b/gcc-4.9/libgfortran/generated/pack_i1.c index b70127d5b..933cf9ab7 100644 --- a/gcc-4.9/libgfortran/generated/pack_i1.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_i16.c b/gcc-4.9/libgfortran/generated/pack_i16.c index da1faefd4..01d32ad0f 100644 --- a/gcc-4.9/libgfortran/generated/pack_i16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_i2.c b/gcc-4.9/libgfortran/generated/pack_i2.c index 0481720d4..de329abf1 100644 --- a/gcc-4.9/libgfortran/generated/pack_i2.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_i4.c b/gcc-4.9/libgfortran/generated/pack_i4.c index 0a0b4ba38..93ac356f8 100644 --- a/gcc-4.9/libgfortran/generated/pack_i4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_i8.c b/gcc-4.9/libgfortran/generated/pack_i8.c index 183a0fef7..ec7b4275c 100644 --- a/gcc-4.9/libgfortran/generated/pack_i8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_r10.c b/gcc-4.9/libgfortran/generated/pack_r10.c index d1c22973d..8b3e81693 100644 --- a/gcc-4.9/libgfortran/generated/pack_r10.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_r16.c b/gcc-4.9/libgfortran/generated/pack_r16.c index 59a6f5872..598ef8e57 100644 --- a/gcc-4.9/libgfortran/generated/pack_r16.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_r4.c b/gcc-4.9/libgfortran/generated/pack_r4.c index 86ec8ffef..955a812d2 100644 --- a/gcc-4.9/libgfortran/generated/pack_r4.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/pack_r8.c b/gcc-4.9/libgfortran/generated/pack_r8.c index 6d7c15510..d0bb227e1 100644 --- a/gcc-4.9/libgfortran/generated/pack_r8.c +++ b/gcc-4.9/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/gcc-4.9/libgfortran/generated/parity_l1.c b/gcc-4.9/libgfortran/generated/parity_l1.c index f71e9ad48..ff81d1ac5 100644 --- a/gcc-4.9/libgfortran/generated/parity_l1.c +++ b/gcc-4.9/libgfortran/generated/parity_l1.c @@ -98,10 +98,9 @@ parity_l1 (gfc_array_l1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/parity_l16.c b/gcc-4.9/libgfortran/generated/parity_l16.c index ba50d9640..66970d00f 100644 --- a/gcc-4.9/libgfortran/generated/parity_l16.c +++ b/gcc-4.9/libgfortran/generated/parity_l16.c @@ -98,10 +98,9 @@ parity_l16 (gfc_array_l16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/parity_l2.c b/gcc-4.9/libgfortran/generated/parity_l2.c index b719eb882..5942257e3 100644 --- a/gcc-4.9/libgfortran/generated/parity_l2.c +++ b/gcc-4.9/libgfortran/generated/parity_l2.c @@ -98,10 +98,9 @@ parity_l2 (gfc_array_l2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/parity_l4.c b/gcc-4.9/libgfortran/generated/parity_l4.c index 7274d72c2..4f8a9f917 100644 --- a/gcc-4.9/libgfortran/generated/parity_l4.c +++ b/gcc-4.9/libgfortran/generated/parity_l4.c @@ -98,10 +98,9 @@ parity_l4 (gfc_array_l4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/parity_l8.c b/gcc-4.9/libgfortran/generated/parity_l8.c index 9c4e57177..73b1d9fba 100644 --- a/gcc-4.9/libgfortran/generated/parity_l8.c +++ b/gcc-4.9/libgfortran/generated/parity_l8.c @@ -98,10 +98,9 @@ parity_l8 (gfc_array_l8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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/gcc-4.9/libgfortran/generated/product_c10.c b/gcc-4.9/libgfortran/generated/product_c10.c index 6b2ea5fb0..7b325837a 100644 --- a/gcc-4.9/libgfortran/generated/product_c10.c +++ b/gcc-4.9/libgfortran/generated/product_c10.c @@ -97,10 +97,9 @@ product_c10 (gfc_array_c10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_c16.c b/gcc-4.9/libgfortran/generated/product_c16.c index 42d5dcdb6..4f31e1b63 100644 --- a/gcc-4.9/libgfortran/generated/product_c16.c +++ b/gcc-4.9/libgfortran/generated/product_c16.c @@ -97,10 +97,9 @@ product_c16 (gfc_array_c16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_c4.c b/gcc-4.9/libgfortran/generated/product_c4.c index 04d3cf9c4..038c502d4 100644 --- a/gcc-4.9/libgfortran/generated/product_c4.c +++ b/gcc-4.9/libgfortran/generated/product_c4.c @@ -97,10 +97,9 @@ product_c4 (gfc_array_c4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_c8.c b/gcc-4.9/libgfortran/generated/product_c8.c index 184e1bc50..a941a6c62 100644 --- a/gcc-4.9/libgfortran/generated/product_c8.c +++ b/gcc-4.9/libgfortran/generated/product_c8.c @@ -97,10 +97,9 @@ product_c8 (gfc_array_c8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_i1.c b/gcc-4.9/libgfortran/generated/product_i1.c index 0a8bc2689..39d94fc81 100644 --- a/gcc-4.9/libgfortran/generated/product_i1.c +++ b/gcc-4.9/libgfortran/generated/product_i1.c @@ -97,10 +97,9 @@ product_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_i16.c b/gcc-4.9/libgfortran/generated/product_i16.c index 97c774afe..a89070a44 100644 --- a/gcc-4.9/libgfortran/generated/product_i16.c +++ b/gcc-4.9/libgfortran/generated/product_i16.c @@ -97,10 +97,9 @@ product_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_i2.c b/gcc-4.9/libgfortran/generated/product_i2.c index 86d85eedd..c8e04ef85 100644 --- a/gcc-4.9/libgfortran/generated/product_i2.c +++ b/gcc-4.9/libgfortran/generated/product_i2.c @@ -97,10 +97,9 @@ product_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_i4.c b/gcc-4.9/libgfortran/generated/product_i4.c index 6e7374032..1d3b9cf6a 100644 --- a/gcc-4.9/libgfortran/generated/product_i4.c +++ b/gcc-4.9/libgfortran/generated/product_i4.c @@ -97,10 +97,9 @@ product_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_i8.c b/gcc-4.9/libgfortran/generated/product_i8.c index c49f57219..7d61b9ba2 100644 --- a/gcc-4.9/libgfortran/generated/product_i8.c +++ b/gcc-4.9/libgfortran/generated/product_i8.c @@ -97,10 +97,9 @@ product_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_r10.c b/gcc-4.9/libgfortran/generated/product_r10.c index 5aa856349..16aa3059e 100644 --- a/gcc-4.9/libgfortran/generated/product_r10.c +++ b/gcc-4.9/libgfortran/generated/product_r10.c @@ -97,10 +97,9 @@ product_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_r16.c b/gcc-4.9/libgfortran/generated/product_r16.c index 63bf37263..3bb085ff1 100644 --- a/gcc-4.9/libgfortran/generated/product_r16.c +++ b/gcc-4.9/libgfortran/generated/product_r16.c @@ -97,10 +97,9 @@ product_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_r4.c b/gcc-4.9/libgfortran/generated/product_r4.c index 2d852130a..18dfdde96 100644 --- a/gcc-4.9/libgfortran/generated/product_r4.c +++ b/gcc-4.9/libgfortran/generated/product_r4.c @@ -97,10 +97,9 @@ product_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/product_r8.c b/gcc-4.9/libgfortran/generated/product_r8.c index 9cb1a177e..7ac062aa9 100644 --- a/gcc-4.9/libgfortran/generated/product_r8.c +++ b/gcc-4.9/libgfortran/generated/product_r8.c @@ -97,10 +97,9 @@ product_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/reshape_c10.c b/gcc-4.9/libgfortran/generated/reshape_c10.c index e516e074c..a7fb560d6 100644 --- a/gcc-4.9/libgfortran/generated/reshape_c10.c +++ b/gcc-4.9/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 * sizeof (GFC_COMPLEX_10); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_c16.c b/gcc-4.9/libgfortran/generated/reshape_c16.c index c374af888..a8186f98d 100644 --- a/gcc-4.9/libgfortran/generated/reshape_c16.c +++ b/gcc-4.9/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 * sizeof (GFC_COMPLEX_16); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_c4.c b/gcc-4.9/libgfortran/generated/reshape_c4.c index b0043028b..1aa1934ce 100644 --- a/gcc-4.9/libgfortran/generated/reshape_c4.c +++ b/gcc-4.9/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 * sizeof (GFC_COMPLEX_4); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_c8.c b/gcc-4.9/libgfortran/generated/reshape_c8.c index 345dcccb2..5b7f79623 100644 --- a/gcc-4.9/libgfortran/generated/reshape_c8.c +++ b/gcc-4.9/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 * sizeof (GFC_COMPLEX_8); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_i16.c b/gcc-4.9/libgfortran/generated/reshape_i16.c index f05a93727..b766e1a9a 100644 --- a/gcc-4.9/libgfortran/generated/reshape_i16.c +++ b/gcc-4.9/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 * sizeof (GFC_INTEGER_16); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_i4.c b/gcc-4.9/libgfortran/generated/reshape_i4.c index 174b4ca94..4831857b8 100644 --- a/gcc-4.9/libgfortran/generated/reshape_i4.c +++ b/gcc-4.9/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 * sizeof (GFC_INTEGER_4); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_i8.c b/gcc-4.9/libgfortran/generated/reshape_i8.c index c37775248..1729d488b 100644 --- a/gcc-4.9/libgfortran/generated/reshape_i8.c +++ b/gcc-4.9/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 * sizeof (GFC_INTEGER_8); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_r10.c b/gcc-4.9/libgfortran/generated/reshape_r10.c index ee2c47f21..f1dd44a43 100644 --- a/gcc-4.9/libgfortran/generated/reshape_r10.c +++ b/gcc-4.9/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 * sizeof (GFC_REAL_10); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_r16.c b/gcc-4.9/libgfortran/generated/reshape_r16.c index 61c8de4d6..360b18ffd 100644 --- a/gcc-4.9/libgfortran/generated/reshape_r16.c +++ b/gcc-4.9/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 * sizeof (GFC_REAL_16); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_r4.c b/gcc-4.9/libgfortran/generated/reshape_r4.c index d7ca64f5e..e06cb5417 100644 --- a/gcc-4.9/libgfortran/generated/reshape_r4.c +++ b/gcc-4.9/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 * sizeof (GFC_REAL_4); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/reshape_r8.c b/gcc-4.9/libgfortran/generated/reshape_r8.c index 9700a5861..08888a8ad 100644 --- a/gcc-4.9/libgfortran/generated/reshape_r8.c +++ b/gcc-4.9/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 * sizeof (GFC_REAL_8); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/generated/shape_i16.c b/gcc-4.9/libgfortran/generated/shape_i16.c index c23f6d4f1..c5047562d 100644 --- a/gcc-4.9/libgfortran/generated/shape_i16.c +++ b/gcc-4.9/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 - 1, 1); 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(ret,0); diff --git a/gcc-4.9/libgfortran/generated/shape_i4.c b/gcc-4.9/libgfortran/generated/shape_i4.c index 1abac162d..0a56fe9fe 100644 --- a/gcc-4.9/libgfortran/generated/shape_i4.c +++ b/gcc-4.9/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 - 1, 1); 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(ret,0); diff --git a/gcc-4.9/libgfortran/generated/shape_i8.c b/gcc-4.9/libgfortran/generated/shape_i8.c index 707d26c0b..6e9dc2258 100644 --- a/gcc-4.9/libgfortran/generated/shape_i8.c +++ b/gcc-4.9/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 - 1, 1); 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(ret,0); diff --git a/gcc-4.9/libgfortran/generated/spread_c10.c b/gcc-4.9/libgfortran/generated/spread_c10.c index ad58e34bc..592443e71 100644 --- a/gcc-4.9/libgfortran/generated/spread_c10.c +++ b/gcc-4.9/libgfortran/generated/spread_c10.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_c16.c b/gcc-4.9/libgfortran/generated/spread_c16.c index 31e82ac58..0fce566d7 100644 --- a/gcc-4.9/libgfortran/generated/spread_c16.c +++ b/gcc-4.9/libgfortran/generated/spread_c16.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_c4.c b/gcc-4.9/libgfortran/generated/spread_c4.c index f17c6ba9f..5d1e86b37 100644 --- a/gcc-4.9/libgfortran/generated/spread_c4.c +++ b/gcc-4.9/libgfortran/generated/spread_c4.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_c8.c b/gcc-4.9/libgfortran/generated/spread_c8.c index 07347a28b..f8b0da8bc 100644 --- a/gcc-4.9/libgfortran/generated/spread_c8.c +++ b/gcc-4.9/libgfortran/generated/spread_c8.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_i1.c b/gcc-4.9/libgfortran/generated/spread_i1.c index 083d26e41..44aef16d3 100644 --- a/gcc-4.9/libgfortran/generated/spread_i1.c +++ b/gcc-4.9/libgfortran/generated/spread_i1.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_i16.c b/gcc-4.9/libgfortran/generated/spread_i16.c index fb565c3c3..f4ad0180c 100644 --- a/gcc-4.9/libgfortran/generated/spread_i16.c +++ b/gcc-4.9/libgfortran/generated/spread_i16.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_i2.c b/gcc-4.9/libgfortran/generated/spread_i2.c index 5895594d8..02e762839 100644 --- a/gcc-4.9/libgfortran/generated/spread_i2.c +++ b/gcc-4.9/libgfortran/generated/spread_i2.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_i4.c b/gcc-4.9/libgfortran/generated/spread_i4.c index 4cb64b0e8..0c8d92736 100644 --- a/gcc-4.9/libgfortran/generated/spread_i4.c +++ b/gcc-4.9/libgfortran/generated/spread_i4.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_i8.c b/gcc-4.9/libgfortran/generated/spread_i8.c index 2013c898e..402c746cf 100644 --- a/gcc-4.9/libgfortran/generated/spread_i8.c +++ b/gcc-4.9/libgfortran/generated/spread_i8.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_r10.c b/gcc-4.9/libgfortran/generated/spread_r10.c index d43f74575..248186eb3 100644 --- a/gcc-4.9/libgfortran/generated/spread_r10.c +++ b/gcc-4.9/libgfortran/generated/spread_r10.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_r16.c b/gcc-4.9/libgfortran/generated/spread_r16.c index f7452a111..50aef1087 100644 --- a/gcc-4.9/libgfortran/generated/spread_r16.c +++ b/gcc-4.9/libgfortran/generated/spread_r16.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_r4.c b/gcc-4.9/libgfortran/generated/spread_r4.c index b5383fa97..fab55c7a1 100644 --- a/gcc-4.9/libgfortran/generated/spread_r4.c +++ b/gcc-4.9/libgfortran/generated/spread_r4.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/spread_r8.c b/gcc-4.9/libgfortran/generated/spread_r8.c index 78bbcdc57..6076638d7 100644 --- a/gcc-4.9/libgfortran/generated/spread_r8.c +++ b/gcc-4.9/libgfortran/generated/spread_r8.c @@ -101,8 +101,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; } @@ -244,7 +244,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 - 1, 1); } diff --git a/gcc-4.9/libgfortran/generated/sum_c10.c b/gcc-4.9/libgfortran/generated/sum_c10.c index cb5fff68b..176623dff 100644 --- a/gcc-4.9/libgfortran/generated/sum_c10.c +++ b/gcc-4.9/libgfortran/generated/sum_c10.c @@ -97,10 +97,9 @@ sum_c10 (gfc_array_c10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_c16.c b/gcc-4.9/libgfortran/generated/sum_c16.c index 3f616ec85..055a65930 100644 --- a/gcc-4.9/libgfortran/generated/sum_c16.c +++ b/gcc-4.9/libgfortran/generated/sum_c16.c @@ -97,10 +97,9 @@ sum_c16 (gfc_array_c16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_c4.c b/gcc-4.9/libgfortran/generated/sum_c4.c index ec5160e3d..6fab436b2 100644 --- a/gcc-4.9/libgfortran/generated/sum_c4.c +++ b/gcc-4.9/libgfortran/generated/sum_c4.c @@ -97,10 +97,9 @@ sum_c4 (gfc_array_c4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_c8.c b/gcc-4.9/libgfortran/generated/sum_c8.c index 946c722d7..c3d35804d 100644 --- a/gcc-4.9/libgfortran/generated/sum_c8.c +++ b/gcc-4.9/libgfortran/generated/sum_c8.c @@ -97,10 +97,9 @@ sum_c8 (gfc_array_c8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray, } - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_i1.c b/gcc-4.9/libgfortran/generated/sum_i1.c index 477581f96..88ee3338b 100644 --- a/gcc-4.9/libgfortran/generated/sum_i1.c +++ b/gcc-4.9/libgfortran/generated/sum_i1.c @@ -97,10 +97,9 @@ sum_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_i16.c b/gcc-4.9/libgfortran/generated/sum_i16.c index 52c12a7df..dc35e0709 100644 --- a/gcc-4.9/libgfortran/generated/sum_i16.c +++ b/gcc-4.9/libgfortran/generated/sum_i16.c @@ -97,10 +97,9 @@ sum_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_i16 (gfc_array_i16 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_i2.c b/gcc-4.9/libgfortran/generated/sum_i2.c index af6e29dee..05c088206 100644 --- a/gcc-4.9/libgfortran/generated/sum_i2.c +++ b/gcc-4.9/libgfortran/generated/sum_i2.c @@ -97,10 +97,9 @@ sum_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_i4.c b/gcc-4.9/libgfortran/generated/sum_i4.c index 87b10c7d0..3653883c4 100644 --- a/gcc-4.9/libgfortran/generated/sum_i4.c +++ b/gcc-4.9/libgfortran/generated/sum_i4.c @@ -97,10 +97,9 @@ sum_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_i8.c b/gcc-4.9/libgfortran/generated/sum_i8.c index bc8b52ebc..d2878df6f 100644 --- a/gcc-4.9/libgfortran/generated/sum_i8.c +++ b/gcc-4.9/libgfortran/generated/sum_i8.c @@ -97,10 +97,9 @@ sum_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray, } - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_r10.c b/gcc-4.9/libgfortran/generated/sum_r10.c index 97bb66f3d..cb5169c8a 100644 --- a/gcc-4.9/libgfortran/generated/sum_r10.c +++ b/gcc-4.9/libgfortran/generated/sum_r10.c @@ -97,10 +97,9 @@ sum_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_r16.c b/gcc-4.9/libgfortran/generated/sum_r16.c index c089cfdfa..6c67f295f 100644 --- a/gcc-4.9/libgfortran/generated/sum_r16.c +++ b/gcc-4.9/libgfortran/generated/sum_r16.c @@ -97,10 +97,9 @@ sum_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_r4.c b/gcc-4.9/libgfortran/generated/sum_r4.c index 2fea0b7e2..a3a4b59ce 100644 --- a/gcc-4.9/libgfortran/generated/sum_r4.c +++ b/gcc-4.9/libgfortran/generated/sum_r4.c @@ -97,10 +97,9 @@ sum_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/sum_r8.c b/gcc-4.9/libgfortran/generated/sum_r8.c index e52795da4..0cbf649db 100644 --- a/gcc-4.9/libgfortran/generated/sum_r8.c +++ b/gcc-4.9/libgfortran/generated/sum_r8.c @@ -97,10 +97,9 @@ sum_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(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. */ @@ -272,8 +271,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray, } - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -285,7 +283,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 @@ -430,8 +428,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -440,7 +437,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/gcc-4.9/libgfortran/generated/transpose_c10.c b/gcc-4.9/libgfortran/generated/transpose_c10.c index e55883383..bd2012209 100644 --- a/gcc-4.9/libgfortran/generated/transpose_c10.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_c16.c b/gcc-4.9/libgfortran/generated/transpose_c16.c index f11128edd..044509f67 100644 --- a/gcc-4.9/libgfortran/generated/transpose_c16.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_c4.c b/gcc-4.9/libgfortran/generated/transpose_c4.c index f1e5fcebe..c6dd90580 100644 --- a/gcc-4.9/libgfortran/generated/transpose_c4.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_c8.c b/gcc-4.9/libgfortran/generated/transpose_c8.c index 46fde201f..cd5926bf8 100644 --- a/gcc-4.9/libgfortran/generated/transpose_c8.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_i16.c b/gcc-4.9/libgfortran/generated/transpose_i16.c index 236fcf1b5..44aff01ff 100644 --- a/gcc-4.9/libgfortran/generated/transpose_i16.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_i4.c b/gcc-4.9/libgfortran/generated/transpose_i4.c index ba875303a..e6844fccb 100644 --- a/gcc-4.9/libgfortran/generated/transpose_i4.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_i8.c b/gcc-4.9/libgfortran/generated/transpose_i8.c index 5514f8039..df4a28af2 100644 --- a/gcc-4.9/libgfortran/generated/transpose_i8.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_r10.c b/gcc-4.9/libgfortran/generated/transpose_r10.c index a7b570653..2ce05798b 100644 --- a/gcc-4.9/libgfortran/generated/transpose_r10.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_r16.c b/gcc-4.9/libgfortran/generated/transpose_r16.c index 3b9681acb..5009d16cc 100644 --- a/gcc-4.9/libgfortran/generated/transpose_r16.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_r4.c b/gcc-4.9/libgfortran/generated/transpose_r4.c index edf43cbbd..71f70fcd9 100644 --- a/gcc-4.9/libgfortran/generated/transpose_r4.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/transpose_r8.c b/gcc-4.9/libgfortran/generated/transpose_r8.c index 852bcdb2e..9f541e0fb 100644 --- a/gcc-4.9/libgfortran/generated/transpose_r8.c +++ b/gcc-4.9/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) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - 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/gcc-4.9/libgfortran/generated/unpack_c10.c b/gcc-4.9/libgfortran/generated/unpack_c10.c index dcdb88d09..6fc2bdc87 100644 --- a/gcc-4.9/libgfortran/generated/unpack_c10.c +++ b/gcc-4.9/libgfortran/generated/unpack_c10.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_c16.c b/gcc-4.9/libgfortran/generated/unpack_c16.c index e7a533111..443a51eea 100644 --- a/gcc-4.9/libgfortran/generated/unpack_c16.c +++ b/gcc-4.9/libgfortran/generated/unpack_c16.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_c4.c b/gcc-4.9/libgfortran/generated/unpack_c4.c index 927a4c34b..c8b30f5e6 100644 --- a/gcc-4.9/libgfortran/generated/unpack_c4.c +++ b/gcc-4.9/libgfortran/generated/unpack_c4.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_c8.c b/gcc-4.9/libgfortran/generated/unpack_c8.c index f58a9876a..60d9de1b6 100644 --- a/gcc-4.9/libgfortran/generated/unpack_c8.c +++ b/gcc-4.9/libgfortran/generated/unpack_c8.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_i1.c b/gcc-4.9/libgfortran/generated/unpack_i1.c index d6c6ee32d..522ce74a9 100644 --- a/gcc-4.9/libgfortran/generated/unpack_i1.c +++ b/gcc-4.9/libgfortran/generated/unpack_i1.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_i16.c b/gcc-4.9/libgfortran/generated/unpack_i16.c index 2a5972539..7e0d1f766 100644 --- a/gcc-4.9/libgfortran/generated/unpack_i16.c +++ b/gcc-4.9/libgfortran/generated/unpack_i16.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_i2.c b/gcc-4.9/libgfortran/generated/unpack_i2.c index 7aeca5066..b0d21dc24 100644 --- a/gcc-4.9/libgfortran/generated/unpack_i2.c +++ b/gcc-4.9/libgfortran/generated/unpack_i2.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_i4.c b/gcc-4.9/libgfortran/generated/unpack_i4.c index 2a385ff13..beac1969a 100644 --- a/gcc-4.9/libgfortran/generated/unpack_i4.c +++ b/gcc-4.9/libgfortran/generated/unpack_i4.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_i8.c b/gcc-4.9/libgfortran/generated/unpack_i8.c index 399bd35a3..75cd2e93f 100644 --- a/gcc-4.9/libgfortran/generated/unpack_i8.c +++ b/gcc-4.9/libgfortran/generated/unpack_i8.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_r10.c b/gcc-4.9/libgfortran/generated/unpack_r10.c index 406395c42..926a45777 100644 --- a/gcc-4.9/libgfortran/generated/unpack_r10.c +++ b/gcc-4.9/libgfortran/generated/unpack_r10.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_r16.c b/gcc-4.9/libgfortran/generated/unpack_r16.c index 0f70e57c5..6fff184cd 100644 --- a/gcc-4.9/libgfortran/generated/unpack_r16.c +++ b/gcc-4.9/libgfortran/generated/unpack_r16.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_r4.c b/gcc-4.9/libgfortran/generated/unpack_r4.c index 8b0dde104..c9008745f 100644 --- a/gcc-4.9/libgfortran/generated/unpack_r4.c +++ b/gcc-4.9/libgfortran/generated/unpack_r4.c @@ -99,7 +99,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 { @@ -244,7 +244,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/gcc-4.9/libgfortran/generated/unpack_r8.c b/gcc-4.9/libgfortran/generated/unpack_r8.c index 13e3540c6..5999a51ab 100644 --- a/gcc-4.9/libgfortran/generated/unpack_r8.c +++ b/gcc-4.9/libgfortran/generated/unpack_r8.c @@ -99,7 +99,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 { @@ -244,7 +244,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 { diff --git a/gcc-4.9/libgfortran/intrinsics/cshift0.c b/gcc-4.9/libgfortran/intrinsics/cshift0.c index 12f828927..f983754f1 100644 --- a/gcc-4.9/libgfortran/intrinsics/cshift0.c +++ b/gcc-4.9/libgfortran/intrinsics/cshift0.c @@ -79,8 +79,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/intrinsics/eoshift0.c b/gcc-4.9/libgfortran/intrinsics/eoshift0.c index 1857ab065..7d3721320 100644 --- a/gcc-4.9/libgfortran/intrinsics/eoshift0.c +++ b/gcc-4.9/libgfortran/intrinsics/eoshift0.c @@ -86,8 +86,8 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array, } - /* 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/gcc-4.9/libgfortran/intrinsics/eoshift2.c b/gcc-4.9/libgfortran/intrinsics/eoshift2.c index ed264920d..c7ec5cf9f 100644 --- a/gcc-4.9/libgfortran/intrinsics/eoshift2.c +++ b/gcc-4.9/libgfortran/intrinsics/eoshift2.c @@ -78,8 +78,8 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array, ret->offset = 0; ret->dtype = array->dtype; - /* 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); for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { diff --git a/gcc-4.9/libgfortran/intrinsics/pack_generic.c b/gcc-4.9/libgfortran/intrinsics/pack_generic.c index 9924223b3..3fbfa0aaa 100644 --- a/gcc-4.9/libgfortran/intrinsics/pack_generic.c +++ b/gcc-4.9/libgfortran/intrinsics/pack_generic.c @@ -152,8 +152,8 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array, GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1); ret->offset = 0; - /* xmalloc allocates a single byte for zero size. */ - ret->base_addr = xmalloc (size * total); + /* xmallocarray allocates a single byte for zero size. */ + ret->base_addr = xmallocarray (total, size); if (total == 0) return; /* In this case, nothing remains to be done. */ @@ -519,7 +519,7 @@ pack_s_internal (gfc_array_char *ret, const gfc_array_char *array, ret->offset = 0; - ret->base_addr = xmalloc (size * total); + ret->base_addr = xmallocarray (total, size); if (total == 0) return; diff --git a/gcc-4.9/libgfortran/intrinsics/reshape_generic.c b/gcc-4.9/libgfortran/intrinsics/reshape_generic.c index 3b2e99487..f742051b5 100644 --- a/gcc-4.9/libgfortran/intrinsics/reshape_generic.c +++ b/gcc-4.9/libgfortran/intrinsics/reshape_generic.c @@ -99,11 +99,11 @@ reshape_internal (parray *ret, parray *source, shape_type *shape, ret->offset = 0; if (unlikely (rs < 1)) - alloc_size = 1; + alloc_size = 0; /* xmalloc will allocate 1 byte. */ else - alloc_size = rs * size; + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, size); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/intrinsics/spread_generic.c b/gcc-4.9/libgfortran/intrinsics/spread_generic.c index 0fe5722f1..f3f23b8ce 100644 --- a/gcc-4.9/libgfortran/intrinsics/spread_generic.c +++ b/gcc-4.9/libgfortran/intrinsics/spread_generic.c @@ -100,7 +100,7 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source, GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride); } ret->offset = 0; - ret->base_addr = xmalloc (rs * size); + ret->base_addr = xmallocarray (rs, size); if (rs <= 0) return; @@ -245,7 +245,7 @@ spread_internal_scalar (gfc_array_char *ret, const char *source, if (ret->base_addr == NULL) { - ret->base_addr = xmalloc (ncopies * size); + ret->base_addr = xmallocarray (ncopies, size); ret->offset = 0; GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1); } diff --git a/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c b/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c index 84182af18..5c50366f3 100644 --- a/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c +++ b/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c @@ -164,7 +164,7 @@ string_trim (gfc_charlen_type *len, CHARTYPE **dest, gfc_charlen_type slen, else { /* Allocate space for result string. */ - *dest = xmalloc (*len * sizeof (CHARTYPE)); + *dest = xmallocarray (*len, sizeof (CHARTYPE)); /* Copy string if necessary. */ memcpy (*dest, src, *len * sizeof (CHARTYPE)); @@ -442,7 +442,7 @@ string_minmax (gfc_charlen_type *rlen, CHARTYPE **dest, int op, int nargs, ...) *dest = &zero_length_string; else { - CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE)); + CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE)); memcpy (tmp, res, reslen * sizeof (CHARTYPE)); MEMSET (&tmp[reslen], ' ', *rlen - reslen); *dest = tmp; diff --git a/gcc-4.9/libgfortran/intrinsics/transpose_generic.c b/gcc-4.9/libgfortran/intrinsics/transpose_generic.c index 5ee12ee10..a5e2947a6 100644 --- a/gcc-4.9/libgfortran/intrinsics/transpose_generic.c +++ b/gcc-4.9/libgfortran/intrinsics/transpose_generic.c @@ -60,7 +60,7 @@ transpose_internal (gfc_array_char *ret, gfc_array_char *source) GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - ret->base_addr = xmalloc (size * size0 ((array_t*)ret)); + ret->base_addr = xmallocarray (size0 ((array_t*)ret), size); ret->offset = 0; } else if (unlikely (compile_options.bounds_check)) diff --git a/gcc-4.9/libgfortran/intrinsics/unpack_generic.c b/gcc-4.9/libgfortran/intrinsics/unpack_generic.c index 5d12cc11c..4bd99278e 100644 --- a/gcc-4.9/libgfortran/intrinsics/unpack_generic.c +++ b/gcc-4.9/libgfortran/intrinsics/unpack_generic.c @@ -125,7 +125,7 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector, rs *= extent[n]; } ret->offset = 0; - ret->base_addr = xmalloc (rs * size); + ret->base_addr = xmallocarray (rs, size); } else { diff --git a/gcc-4.9/libgfortran/io/list_read.c b/gcc-4.9/libgfortran/io/list_read.c index d871ce9be..b64189afe 100644 --- a/gcc-4.9/libgfortran/io/list_read.c +++ b/gcc-4.9/libgfortran/io/list_read.c @@ -2407,7 +2407,7 @@ nml_touch_nodes (namelist_info * nl) { index_type len = strlen (nl->var_name) + 1; int dim; - char * ext_name = (char*)xmalloc (len + 1); + char * ext_name = xmalloc (len + 1); memcpy (ext_name, nl->var_name, len-1); memcpy (ext_name + len - 1, "%", 2); for (nl = nl->next; nl; nl = nl->next) diff --git a/gcc-4.9/libgfortran/io/transfer.c b/gcc-4.9/libgfortran/io/transfer.c index cfe92ca06..60b6012c7 100644 --- a/gcc-4.9/libgfortran/io/transfer.c +++ b/gcc-4.9/libgfortran/io/transfer.c @@ -3786,9 +3786,9 @@ st_set_nml_var (st_parameter_dt *dtp, void * var_addr, char * var_name, if (nml->var_rank > 0) { nml->dim = (descriptor_dimension*) - xmalloc (nml->var_rank * sizeof (descriptor_dimension)); + xmallocarray (nml->var_rank, sizeof (descriptor_dimension)); nml->ls = (array_loop_spec*) - xmalloc (nml->var_rank * sizeof (array_loop_spec)); + xmallocarray (nml->var_rank, sizeof (array_loop_spec)); } else { diff --git a/gcc-4.9/libgfortran/io/unit.c b/gcc-4.9/libgfortran/io/unit.c index 385818adc..d191a8ae2 100644 --- a/gcc-4.9/libgfortran/io/unit.c +++ b/gcc-4.9/libgfortran/io/unit.c @@ -454,7 +454,7 @@ get_internal_unit (st_parameter_dt *dtp) { iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc); iunit->ls = (array_loop_spec *) - xmalloc (iunit->rank * sizeof (array_loop_spec)); + xmallocarray (iunit->rank, sizeof (array_loop_spec)); dtp->internal_unit_len *= init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record); diff --git a/gcc-4.9/libgfortran/io/write.c b/gcc-4.9/libgfortran/io/write.c index eccbe7e2a..f76ec673b 100644 --- a/gcc-4.9/libgfortran/io/write.c +++ b/gcc-4.9/libgfortran/io/write.c @@ -1864,7 +1864,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset, base_var_name_len = base ? strlen (base->var_name) : 0; ext_name_len = base_name_len + base_var_name_len + strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1; - ext_name = (char*)xmalloc (ext_name_len); + ext_name = xmalloc (ext_name_len); memcpy (ext_name, base_name, base_name_len); clen = strlen (obj->var_name + base_var_name_len); @@ -1893,7 +1893,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset, /* Now obj_name. */ obj_name_len = strlen (obj->var_name) + 1; - obj_name = xmalloc (obj_name_len+1); + obj_name = xmalloc (obj_name_len + 1); memcpy (obj_name, obj->var_name, obj_name_len-1); memcpy (obj_name + obj_name_len-1, "%", 2); diff --git a/gcc-4.9/libgfortran/libgfortran.h b/gcc-4.9/libgfortran/libgfortran.h index 0d6f432a2..e01d215dd 100644 --- a/gcc-4.9/libgfortran/libgfortran.h +++ b/gcc-4.9/libgfortran/libgfortran.h @@ -768,6 +768,9 @@ internal_proto(get_fpu_rounding_mode); extern void *xmalloc (size_t) __attribute__ ((malloc)); internal_proto(xmalloc); +extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc)); +internal_proto(xmallocarray); + extern void *xcalloc (size_t, size_t) __attribute__ ((malloc)); internal_proto(xcalloc); diff --git a/gcc-4.9/libgfortran/m4/bessel.m4 b/gcc-4.9/libgfortran/m4/bessel.m4 index 15127e558..36ffd3356 100644 --- a/gcc-4.9/libgfortran/m4/bessel.m4 +++ b/gcc-4.9/libgfortran/m4/bessel.m4 @@ -56,7 +56,7 @@ bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, 'rtype_na { size_t size = n2 < n1 ? 0 : n2-n1+1; GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); - ret->base_addr = xmalloc (sizeof ('rtype_name`) * size); + ret->base_addr = xmallocarray (size, sizeof ('rtype_name`)); ret->offset = 0; } @@ -123,7 +123,7 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, { size_t size = n2 < n1 ? 0 : n2-n1+1; GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); - ret->base_addr = xmalloc (sizeof ('rtype_name`) * size); + ret->base_addr = xmallocarray (size, sizeof ('rtype_name`)); ret->offset = 0; } diff --git a/gcc-4.9/libgfortran/m4/cshift1.m4 b/gcc-4.9/libgfortran/m4/cshift1.m4 index 602bf9edb..e743e9e90 100644 --- a/gcc-4.9/libgfortran/m4/cshift1.m4 +++ b/gcc-4.9/libgfortran/m4/cshift1.m4 @@ -81,7 +81,7 @@ cshift1 (gfc_array_char * const restrict ret, { int i; - ret->base_addr = xmalloc (size * arraysize); + ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) diff --git a/gcc-4.9/libgfortran/m4/eoshift1.m4 b/gcc-4.9/libgfortran/m4/eoshift1.m4 index c373afe4b..df785ecdc 100644 --- a/gcc-4.9/libgfortran/m4/eoshift1.m4 +++ b/gcc-4.9/libgfortran/m4/eoshift1.m4 @@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/m4/eoshift3.m4 b/gcc-4.9/libgfortran/m4/eoshift3.m4 index f1997df36..1a257d98f 100644 --- a/gcc-4.9/libgfortran/m4/eoshift3.m4 +++ b/gcc-4.9/libgfortran/m4/eoshift3.m4 @@ -90,7 +90,7 @@ eoshift3 (gfc_array_char * const restrict ret, { int i; - ret->base_addr = xmalloc (size * arraysize); + ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -108,8 +108,8 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } - /* 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/gcc-4.9/libgfortran/m4/iforeach.m4 b/gcc-4.9/libgfortran/m4/iforeach.m4 index a875a2ac2..2b916af66 100644 --- a/gcc-4.9/libgfortran/m4/iforeach.m4 +++ b/gcc-4.9/libgfortran/m4/iforeach.m4 @@ -30,7 +30,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (rtype_name) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); } else { @@ -133,7 +133,7 @@ void GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (rtype_name) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); } else { @@ -264,7 +264,7 @@ void GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1; retarray->offset = 0; - retarray->base_addr = xmalloc (sizeof (rtype_name) * rank); + retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/gcc-4.9/libgfortran/m4/ifunction.m4 b/gcc-4.9/libgfortran/m4/ifunction.m4 index 1555aebbc..b4de9a876 100644 --- a/gcc-4.9/libgfortran/m4/ifunction.m4 +++ b/gcc-4.9/libgfortran/m4/ifunction.m4 @@ -85,10 +85,9 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmalloc (alloc_size); + retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -260,8 +259,7 @@ void } - alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; @@ -273,7 +271,7 @@ void return; } else - retarray->base_addr = xmalloc (alloc_size); + retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name)); } else @@ -417,8 +415,7 @@ void retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -427,7 +424,7 @@ void return; } else - retarray->base_addr = xmalloc (alloc_size); + retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name)); } else { diff --git a/gcc-4.9/libgfortran/m4/ifunction_logical.m4 b/gcc-4.9/libgfortran/m4/ifunction_logical.m4 index 13dd7a928..fd3afb074 100644 --- a/gcc-4.9/libgfortran/m4/ifunction_logical.m4 +++ b/gcc-4.9/libgfortran/m4/ifunction_logical.m4 @@ -89,8 +89,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, retarray->offset = 0; retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank; - alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1) - * extent[rank-1]; + alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; if (alloc_size == 0) { @@ -99,7 +98,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, return; } else - retarray->base_addr = xmalloc (alloc_size); + retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name)); } else { diff --git a/gcc-4.9/libgfortran/m4/in_pack.m4 b/gcc-4.9/libgfortran/m4/in_pack.m4 index 9d515d42b..a807e71e5 100644 --- a/gcc-4.9/libgfortran/m4/in_pack.m4 +++ b/gcc-4.9/libgfortran/m4/in_pack.m4 @@ -79,7 +79,7 @@ internal_pack_'rtype_ccode` ('rtype` * source) return source->base_addr; /* Allocate storage for the destination. */ - destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`)); + destptr = xmallocarray (ssize, sizeof ('rtype_name`)); dest = destptr; src = source->base_addr; stride0 = stride[0]; diff --git a/gcc-4.9/libgfortran/m4/matmul.m4 b/gcc-4.9/libgfortran/m4/matmul.m4 index 937daa829..e5f43e2d6 100644 --- a/gcc-4.9/libgfortran/m4/matmul.m4 +++ b/gcc-4.9/libgfortran/m4/matmul.m4 @@ -125,7 +125,7 @@ matmul_'rtype_code` ('rtype` * const restrict retarray, } retarray->base_addr - = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray)); + = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`)); retarray->offset = 0; } else if (unlikely (compile_options.bounds_check)) diff --git a/gcc-4.9/libgfortran/m4/matmull.m4 b/gcc-4.9/libgfortran/m4/matmull.m4 index 25bdc75b9..4be37d5a8 100644 --- a/gcc-4.9/libgfortran/m4/matmull.m4 +++ b/gcc-4.9/libgfortran/m4/matmull.m4 @@ -89,7 +89,7 @@ matmul_'rtype_code` ('rtype` * const restrict retarray, } retarray->base_addr - = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray)); + = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`)); retarray->offset = 0; } else if (unlikely (compile_options.bounds_check)) diff --git a/gcc-4.9/libgfortran/m4/pack.m4 b/gcc-4.9/libgfortran/m4/pack.m4 index 8495de4ef..a5517d07b 100644 --- a/gcc-4.9/libgfortran/m4/pack.m4 +++ b/gcc-4.9/libgfortran/m4/pack.m4 @@ -168,8 +168,8 @@ pack_'rtype_code` ('rtype` *ret, const 'rtype` *array, ret->offset = 0; - /* xmalloc allocates a single byte for zero size. */ - ret->base_addr = xmalloc (sizeof ('rtype_name`) * total); + /* xmallocarray allocates a single byte for zero size. */ + ret->base_addr = xmallocarray (total, sizeof ('rtype_name`)); if (total == 0) return; diff --git a/gcc-4.9/libgfortran/m4/reshape.m4 b/gcc-4.9/libgfortran/m4/reshape.m4 index 943f3e936..6341b6e9a 100644 --- a/gcc-4.9/libgfortran/m4/reshape.m4 +++ b/gcc-4.9/libgfortran/m4/reshape.m4 @@ -115,11 +115,11 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, ret->offset = 0; if (unlikely (rs < 1)) - alloc_size = 1; + alloc_size = 0; else - alloc_size = rs * sizeof ('rtype_name`); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } diff --git a/gcc-4.9/libgfortran/m4/shape.m4 b/gcc-4.9/libgfortran/m4/shape.m4 index 85dd233d1..9d02c6c40 100644 --- a/gcc-4.9/libgfortran/m4/shape.m4 +++ b/gcc-4.9/libgfortran/m4/shape.m4 @@ -50,7 +50,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret, { GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1); ret->offset = 0; - ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank); + ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`)); } stride = GFC_DESCRIPTOR_STRIDE(ret,0); diff --git a/gcc-4.9/libgfortran/m4/spread.m4 b/gcc-4.9/libgfortran/m4/spread.m4 index 82ae240e1..62cfd81de 100644 --- a/gcc-4.9/libgfortran/m4/spread.m4 +++ b/gcc-4.9/libgfortran/m4/spread.m4 @@ -102,8 +102,8 @@ spread_'rtype_code` ('rtype` *ret, const 'rtype` *source, } ret->offset = 0; - /* xmalloc allocates a single byte for zero size. */ - ret->base_addr = xmalloc (rs * sizeof('rtype_name`)); + /* xmallocarray allocates a single byte for zero size. */ + ret->base_addr = xmallocarray (rs, sizeof('rtype_name`)); if (rs <= 0) return; } @@ -245,7 +245,7 @@ spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source, if (ret->base_addr == NULL) { - ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`)); + ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`)); ret->offset = 0; GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1); } diff --git a/gcc-4.9/libgfortran/m4/transpose.m4 b/gcc-4.9/libgfortran/m4/transpose.m4 index da4f782b0..6d9f4764c 100644 --- a/gcc-4.9/libgfortran/m4/transpose.m4 +++ b/gcc-4.9/libgfortran/m4/transpose.m4 @@ -61,7 +61,8 @@ transpose_'rtype_code` ('rtype` * const restrict ret, GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1, GFC_DESCRIPTOR_EXTENT(source, 1)); - ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret)); + ret->base_addr = xmallocarray (size0 ((array_t *) ret), + sizeof ('rtype_name`)); ret->offset = 0; } else if (unlikely (compile_options.bounds_check)) { diff --git a/gcc-4.9/libgfortran/m4/unpack.m4 b/gcc-4.9/libgfortran/m4/unpack.m4 index 4382ac425..e945446d8 100644 --- a/gcc-4.9/libgfortran/m4/unpack.m4 +++ b/gcc-4.9/libgfortran/m4/unpack.m4 @@ -100,7 +100,7 @@ unpack0_'rtype_code` ('rtype` *ret, const 'rtype` *vector, rs *= extent[n]; } ret->offset = 0; - ret->base_addr = xmalloc (rs * sizeof ('rtype_name`)); + ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`)); } else { @@ -245,7 +245,7 @@ unpack1_'rtype_code` ('rtype` *ret, const 'rtype` *vector, rs *= extent[n]; } ret->offset = 0; - ret->base_addr = xmalloc (rs * sizeof ('rtype_name`)); + ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`)); } else { diff --git a/gcc-4.9/libgfortran/runtime/convert_char.c b/gcc-4.9/libgfortran/runtime/convert_char.c index aa819912a..c3cd1c28c 100644 --- a/gcc-4.9/libgfortran/runtime/convert_char.c +++ b/gcc-4.9/libgfortran/runtime/convert_char.c @@ -44,7 +44,7 @@ convert_char1_to_char4 (gfc_char4_t **dst, gfc_charlen_type len, gfc_charlen_type i, l; l = len > 0 ? len : 0; - *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t)); + *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t)); for (i = 0; i < l; i++) (*dst)[i] = src[i]; @@ -60,7 +60,7 @@ convert_char4_to_char1 (unsigned char **dst, gfc_charlen_type len, gfc_charlen_type i, l; l = len > 0 ? len : 0; - *dst = xmalloc ((l + 1) * sizeof (unsigned char)); + *dst = xmalloc (l + 1); for (i = 0; i < l; i++) (*dst)[i] = src[i]; diff --git a/gcc-4.9/libgfortran/runtime/environ.c b/gcc-4.9/libgfortran/runtime/environ.c index 0c0e9308f..1095f443a 100644 --- a/gcc-4.9/libgfortran/runtime/environ.c +++ b/gcc-4.9/libgfortran/runtime/environ.c @@ -837,7 +837,7 @@ void init_unformatted (variable * v) } else { - elist = xmalloc (unit_count * sizeof (exception_t)); + elist = xmallocarray (unit_count, sizeof (exception_t)); do_count = 0; p = val; do_parse (); diff --git a/gcc-4.9/libgfortran/runtime/in_pack_generic.c b/gcc-4.9/libgfortran/runtime/in_pack_generic.c index 1b8c55843..aab155df6 100644 --- a/gcc-4.9/libgfortran/runtime/in_pack_generic.c +++ b/gcc-4.9/libgfortran/runtime/in_pack_generic.c @@ -180,7 +180,7 @@ internal_pack (gfc_array_char * source) return source->base_addr; /* Allocate storage for the destination. */ - destptr = xmalloc (ssize * size); + destptr = xmallocarray (ssize, size); dest = (char *)destptr; src = source->base_addr; stride0 = stride[0] * size; diff --git a/gcc-4.9/libgfortran/runtime/memory.c b/gcc-4.9/libgfortran/runtime/memory.c index efeea86f1..c1e735894 100644 --- a/gcc-4.9/libgfortran/runtime/memory.c +++ b/gcc-4.9/libgfortran/runtime/memory.c @@ -25,6 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include <stdlib.h> +#include <errno.h> + +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t)-1) +#endif void * @@ -44,12 +49,34 @@ xmalloc (size_t n) } +void * +xmallocarray (size_t nmemb, size_t size) +{ + void *p; + + if (!nmemb || !size) + size = nmemb = 1; + else if (nmemb > SIZE_MAX / size) + { + errno = ENOMEM; + os_error ("Integer overflow in xmallocarray"); + } + + p = malloc (nmemb * size); + + if (!p) + os_error ("Memory allocation failed in xmallocarray"); + + return p; +} + + /* calloc wrapper that aborts on error. */ void * xcalloc (size_t nmemb, size_t size) { - if (nmemb * size == 0) + if (!nmemb || !size) nmemb = size = 1; void *p = calloc (nmemb, size); |