summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-23 20:19:06 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-23 20:19:06 +0000
commitdea399b9ca84ed668aa3da7477dacd04e0192fa5 (patch)
treee4235e098426338fd3e0a267c1a8652af558814c /libgfortran
parent3d956c0659ce15647c319f5e5988034f9e157095 (diff)
downloadgcc-dea399b9ca84ed668aa3da7477dacd04e0192fa5.tar.gz
2008-10-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r141325 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog31
-rw-r--r--libgfortran/generated/transpose_c10.c22
-rw-r--r--libgfortran/generated/transpose_c16.c22
-rw-r--r--libgfortran/generated/transpose_c4.c22
-rw-r--r--libgfortran/generated/transpose_c8.c22
-rw-r--r--libgfortran/generated/transpose_i16.c22
-rw-r--r--libgfortran/generated/transpose_i4.c22
-rw-r--r--libgfortran/generated/transpose_i8.c22
-rw-r--r--libgfortran/generated/transpose_r10.c22
-rw-r--r--libgfortran/generated/transpose_r16.c22
-rw-r--r--libgfortran/generated/transpose_r4.c22
-rw-r--r--libgfortran/generated/transpose_r8.c22
-rw-r--r--libgfortran/intrinsics/transpose_generic.c23
-rw-r--r--libgfortran/io/list_read.c48
-rw-r--r--libgfortran/io/write.c14
-rw-r--r--libgfortran/io/write_float.def16
-rw-r--r--libgfortran/m4/transpose.m422
17 files changed, 337 insertions, 59 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index cf3d9302673..c4630a57f11 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,34 @@
+2008-10-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/37707
+ * io/list_read.c (read_character): Remove code to look ahead in namelist
+ reads to descriminate non-delimited strings from namelist objects.
+ * io/write.c (namelist_write): Delimit character strings with quote or
+ apostrophe, defaulting to quote.
+
+2008-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/34670
+ * intrinsics/transpose_generic.c: Implement bounds checking.
+ * m4/transpose.m4: Likewise.
+ * generated/transpose_c8.c: Regenerated.
+ * generated/transpose_c16.c: Regenerated.
+ * generated/transpose_r10.c: Regenerated.
+ * generated/transpose_i8.c: Regenerated.
+ * generated/transpose_c10.c: Regenerated.
+ * generated/transpose_r4.c: Regenerated.
+ * generated/transpose_c4.c: Regenerated.
+ * generated/transpose_i16.c: Regenerated.
+ * generated/transpose_i4.c: Regenerated.
+ * generated/transpose_r8.c: Regenerated.
+ * generated/transpose_r16.c: Regenerated.
+
+2008-10-19 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37834
+ * io/write_float.def (output_float): Emit '0.' for special case of
+ format specifier 'f0.0' and value of zero. Likewise emit '0' for 'f1.0'.
+
2008-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37863
diff --git a/libgfortran/generated/transpose_c10.c b/libgfortran/generated/transpose_c10.c
index 72235967b34..65760e28051 100644
--- a/libgfortran/generated/transpose_c10.c
+++ b/libgfortran/generated/transpose_c10.c
@@ -69,6 +69,28 @@ transpose_c10 (gfc_array_c10 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_c16.c b/libgfortran/generated/transpose_c16.c
index e3863f1f2ad..94b5b96e3f1 100644
--- a/libgfortran/generated/transpose_c16.c
+++ b/libgfortran/generated/transpose_c16.c
@@ -69,6 +69,28 @@ transpose_c16 (gfc_array_c16 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_c4.c b/libgfortran/generated/transpose_c4.c
index cdb5a9a06e1..14cc7cadc62 100644
--- a/libgfortran/generated/transpose_c4.c
+++ b/libgfortran/generated/transpose_c4.c
@@ -69,6 +69,28 @@ transpose_c4 (gfc_array_c4 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_c8.c b/libgfortran/generated/transpose_c8.c
index 91fb1042499..219331ba5f7 100644
--- a/libgfortran/generated/transpose_c8.c
+++ b/libgfortran/generated/transpose_c8.c
@@ -69,6 +69,28 @@ transpose_c8 (gfc_array_c8 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_i16.c b/libgfortran/generated/transpose_i16.c
index b7564ad17aa..83d6257b3e2 100644
--- a/libgfortran/generated/transpose_i16.c
+++ b/libgfortran/generated/transpose_i16.c
@@ -69,6 +69,28 @@ transpose_i16 (gfc_array_i16 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_i4.c b/libgfortran/generated/transpose_i4.c
index 51472fd09a0..f2a79cd02da 100644
--- a/libgfortran/generated/transpose_i4.c
+++ b/libgfortran/generated/transpose_i4.c
@@ -69,6 +69,28 @@ transpose_i4 (gfc_array_i4 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_i8.c b/libgfortran/generated/transpose_i8.c
index 37428ddacbd..8c065de9029 100644
--- a/libgfortran/generated/transpose_i8.c
+++ b/libgfortran/generated/transpose_i8.c
@@ -69,6 +69,28 @@ transpose_i8 (gfc_array_i8 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_r10.c b/libgfortran/generated/transpose_r10.c
index 32704166b1d..189e0dd726d 100644
--- a/libgfortran/generated/transpose_r10.c
+++ b/libgfortran/generated/transpose_r10.c
@@ -69,6 +69,28 @@ transpose_r10 (gfc_array_r10 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_r16.c b/libgfortran/generated/transpose_r16.c
index 858b3a56555..928b1835533 100644
--- a/libgfortran/generated/transpose_r16.c
+++ b/libgfortran/generated/transpose_r16.c
@@ -69,6 +69,28 @@ transpose_r16 (gfc_array_r16 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_r4.c b/libgfortran/generated/transpose_r4.c
index 1968302dd35..0cb2404b7bd 100644
--- a/libgfortran/generated/transpose_r4.c
+++ b/libgfortran/generated/transpose_r4.c
@@ -69,6 +69,28 @@ transpose_r4 (gfc_array_r4 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/generated/transpose_r8.c b/libgfortran/generated/transpose_r8.c
index bbd87649126..78ae4a1a95a 100644
--- a/libgfortran/generated/transpose_r8.c
+++ b/libgfortran/generated/transpose_r8.c
@@ -69,6 +69,28 @@ transpose_r8 (gfc_array_r8 * const restrict ret,
ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;
diff --git a/libgfortran/intrinsics/transpose_generic.c b/libgfortran/intrinsics/transpose_generic.c
index 5b1929ca55d..d51fa310d5a 100644
--- a/libgfortran/intrinsics/transpose_generic.c
+++ b/libgfortran/intrinsics/transpose_generic.c
@@ -68,6 +68,29 @@ transpose_internal (gfc_array_char *ret, gfc_array_char *source,
ret->data = internal_malloc_size (size * size0 ((array_t*)ret));
ret->offset = 0;
}
+ else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ }
sxstride = source->dim[0].stride * size;
systride = source->dim[1].stride * size;
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 00cd841df24..1f1023c10d2 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -929,52 +929,8 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
default:
if (dtp->u.p.namelist_mode)
{
- if (dtp->u.p.current_unit->delim_status == DELIM_APOSTROPHE
- || dtp->u.p.current_unit->delim_status == DELIM_QUOTE
- || c == '&' || c == '$' || c == '/')
- {
- unget_char (dtp, c);
- return;
- }
-
- /* Check to see if we are seeing a namelist object name by using the
- line buffer and looking ahead for an '=' or '('. */
- l_push_char (dtp, c);
-
- int i;
- for(i = 0; i < 63; i++)
- {
- c = next_char (dtp);
- if (is_separator(c))
- {
- unget_char (dtp, c);
- eat_separator (dtp);
- c = next_char (dtp);
- if (c != '=')
- {
- l_push_char (dtp, c);
- dtp->u.p.item_count = 0;
- dtp->u.p.line_buffer_enabled = 1;
- goto get_string;
- }
- }
-
- l_push_char (dtp, c);
-
- if (c == '=' || c == '(')
- {
- dtp->u.p.item_count = 0;
- dtp->u.p.nml_read_error = 1;
- dtp->u.p.line_buffer_enabled = 1;
- return;
- }
- }
-
- /* The string is too long to be a valid object name so assume that it
- is a string to be read in as a value. */
- dtp->u.p.item_count = 0;
- dtp->u.p.line_buffer_enabled = 1;
- goto get_string;
+ unget_char (dtp, c);
+ return;
}
push_char (dtp, c);
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 020f473da7f..12ff2953c62 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -1442,20 +1442,8 @@ namelist_write (st_parameter_dt *dtp)
/* Set the delimiter for namelist output. */
tmp_delim = dtp->u.p.current_unit->delim_status;
- switch (tmp_delim)
- {
- case (DELIM_QUOTE):
- dtp->u.p.nml_delim = '"';
- break;
-
- case (DELIM_APOSTROPHE):
- dtp->u.p.nml_delim = '\'';
- break;
- default:
- dtp->u.p.nml_delim = '\0';
- break;
- }
+ dtp->u.p.nml_delim = tmp_delim == DELIM_APOSTROPHE ? '\'' : '"';
/* Temporarily disable namelist delimters. */
dtp->u.p.current_unit->delim_status = DELIM_NONE;
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 73a6ed14a1b..d55e3799946 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -119,6 +119,22 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
sign = calculate_sign (dtp, sign_bit);
else
sign = calculate_sign (dtp, 0);
+
+ /* Handle special cases. */
+ if (w == 0)
+ w = 2;
+
+ /* For this one we choose to not output a decimal point.
+ F95 10.5.1.2.1 */
+ if (w == 1 && ft == FMT_F)
+ {
+ out = write_block (dtp, w);
+ if (out == NULL)
+ return;
+ *out = '0';
+ return;
+ }
+
}
/* Normalize the fractional component. */
diff --git a/libgfortran/m4/transpose.m4 b/libgfortran/m4/transpose.m4
index 103cc0296fb..de543eefca7 100644
--- a/libgfortran/m4/transpose.m4
+++ b/libgfortran/m4/transpose.m4
@@ -70,6 +70,28 @@ transpose_'rtype_code` ('rtype` * const restrict ret,
ret->data = internal_malloc_size (sizeof ('rtype_name`) * size0 ((array_t *) ret));
ret->offset = 0;
+ } else if (unlikely (compile_options.bounds_check))
+ {
+ index_type ret_extent, src_extent;
+
+ ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 1: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
+ ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound;
+ src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+
+ if (src_extent != ret_extent)
+ runtime_error ("Incorrect extent in return value of TRANSPOSE"
+ " intrinsic in dimension 2: is %ld,"
+ " should be %ld", (long int) src_extent,
+ (long int) ret_extent);
+
}
sxstride = source->dim[0].stride;