diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 21:17:18 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 21:17:18 +0000 |
| commit | afa0f38f8ab4f63cbb3ec5374285123bb3cbffe3 (patch) | |
| tree | 4fb96003b004905eebacb01b94b3de90448d7d5f /gcc/fortran/iresolve.c | |
| parent | 4b8fa64c59d45853be3d842eba82519b2f0b654e (diff) | |
| download | ppe42-gcc-afa0f38f8ab4f63cbb3ec5374285123bb3cbffe3.tar.gz ppe42-gcc-afa0f38f8ab4f63cbb3ec5374285123bb3cbffe3.zip | |
* intrinsic.c (gfc_convert_type_warn): Propagate the input shape
to the output expression.
* iresolve.c (gfc_resolve_cshift, gfc_resolve_eoshift): Suppress
warning conversion.
(gfc_resolve_reshape): Force convert SHAPE and ORDER parameters
to index kind.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/iresolve.c')
| -rw-r--r-- | gcc/fortran/iresolve.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 75168757fb7..687421b0b6c 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -421,7 +421,7 @@ gfc_resolve_cshift (gfc_expr * f, gfc_expr * array, gfc_resolve_index (dim, 1); /* Convert dim to shift's kind, so we don't need so many variations. */ if (dim->ts.kind != shift->ts.kind) - gfc_convert_type (dim, &shift->ts, 2); + gfc_convert_type_warn (dim, &shift->ts, 2, 0); } f->value.function.name = gfc_get_string ("__cshift%d_%d", n, shift->ts.kind); @@ -510,7 +510,7 @@ gfc_resolve_eoshift (gfc_expr * f, gfc_expr * array, /* Convert dim to the same type as shift, so we don't need quite so many variations. */ if (dim != NULL && dim->ts.kind != shift->ts.kind) - gfc_convert_type (dim, &shift->ts, 2); + gfc_convert_type_warn (dim, &shift->ts, 2, 0); f->value.function.name = gfc_get_string ("__eoshift%d_%d", n, shift->ts.kind); @@ -1172,6 +1172,17 @@ gfc_resolve_reshape (gfc_expr * f, gfc_expr * source, gfc_expr * shape, c = c->next; } } + + /* Force-convert both SHAPE and ORDER to index_kind so that we don't need + so many runtime variations. */ + if (shape->ts.kind != gfc_index_integer_kind) + { + gfc_typespec ts = shape->ts; + ts.kind = gfc_index_integer_kind; + gfc_convert_type_warn (shape, &ts, 2, 0); + } + if (order && order->ts.kind != gfc_index_integer_kind) + gfc_convert_type_warn (order, &shape->ts, 2, 0); } |

