aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/iresolve.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-08 13:17:18 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-08 13:17:18 -0800
commit323c74dacc07833f98c5f289b4146ecdab63496a (patch)
tree4fb96003b004905eebacb01b94b3de90448d7d5f /gcc/fortran/iresolve.c
parent1b227ee01aa9462531fdb1dc3d95e0d674f9c16a (diff)
downloadgcc-323c74dacc07833f98c5f289b4146ecdab63496a.zip
gcc-323c74dacc07833f98c5f289b4146ecdab63496a.tar.gz
gcc-323c74dacc07833f98c5f289b4146ecdab63496a.tar.bz2
intrinsic.c (gfc_convert_type_warn): Propagate the input shape to the output expression.
* 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. From-SVN: r91917
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r--gcc/fortran/iresolve.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 7516875..687421b 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);
}