diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-07-05 18:16:17 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-07-05 18:16:17 +0000 |
commit | a787f6f9ec01a53bc6734940d79edc191be7a908 (patch) | |
tree | 39e9a0538999ccc19813d9e4c1132c8912803e5a /libgfortran/generated/pack_c16.c | |
parent | 3c428fb33318e82ec37beef8f68f5c1456ab68a8 (diff) | |
download | gcc-a787f6f9ec01a53bc6734940d79edc191be7a908.zip gcc-a787f6f9ec01a53bc6734940d79edc191be7a908.tar.gz gcc-a787f6f9ec01a53bc6734940d79edc191be7a908.tar.bz2 |
memory.c (internal_malloc_size): If size is zero, allocate a single byte.
2011-07-05 Thomas Koenig <tkoenig@gcc.gnu.org>
* runtime/memory.c (internal_malloc_size): If size is zero,
allocate a single byte.
* m4/pack.m4 (pack_'rtype_code`): Don't check for zero size
for the argument of internal_malloc_size.
* m4/spread.m4 (spread_'rtype_code`): Likewise.
* m4/eoshift1.m4 (eoshift1): Don't allocate twice. Don't check
for zero size for the argument of internal_malloc_size.
* m4/eoshift3.m4: Don't check for zero size for the argument of
internal_malloc_size.
* intrinsics/pack_generic.c (pack_internal): Likewise.
(pack_s_internal): Likewise.
* intrinsics/cshift0.c (cshift0): Likewise.
* intrinsics/spread_generic.c (spread_internal): Likewise.
* intrinsics/eoshift0.c (eoshift0): Likewise.
* intrinsics/eoshift2.c (eoshift2): Likewise.
* generated/eoshift1_16.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/pack_c10.c: Regenerated.
* generated/pack_c16.c: Regenerated.
* generated/pack_c4.c: Regenerated.
* generated/pack_c8.c: Regenerated.
* generated/pack_i16.c: Regenerated.
* generated/pack_i1.c: Regenerated.
* generated/pack_i2.c: Regenerated.
* generated/pack_i4.c: Regenerated.
* generated/pack_i8.c: Regenerated.
* generated/pack_r10.c: Regenerated.
* generated/pack_r16.c: Regenerated.
* generated/pack_r4.c: Regenerated.
* generated/pack_r8.c: Regenerated.
* generated/spread_c10.c: Regenerated.
* generated/spread_c16.c: Regenerated.
* generated/spread_c4.c: Regenerated.
* generated/spread_c8.c: Regenerated.
* generated/spread_i16.c: Regenerated.
* generated/spread_i1.c: Regenerated.
* generated/spread_i2.c: Regenerated.
* generated/spread_i4.c: Regenerated.
* generated/spread_i8.c: Regenerated.
* generated/spread_r10.c: Regenerated.
* generated/spread_r16.c: Regenerated.
* generated/spread_r4.c: Regenerated.
* generated/spread_r8.c: Regenerated.
From-SVN: r175880
Diffstat (limited to 'libgfortran/generated/pack_c16.c')
-rw-r--r-- | libgfortran/generated/pack_c16.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libgfortran/generated/pack_c16.c b/libgfortran/generated/pack_c16.c index 9397262..e98de98 100644 --- a/libgfortran/generated/pack_c16.c +++ b/libgfortran/generated/pack_c16.c @@ -166,14 +166,12 @@ pack_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1); ret->offset = 0; + + /* internal_malloc_size allocates a single byte for zero size. */ + ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_16) * total); + if (total == 0) - { - /* In this case, nothing remains to be done. */ - ret->data = internal_malloc_size (1); - return; - } - else - ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_16) * total); + return; } else { |