diff options
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 195f05e..6c23d4a 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -105,9 +105,17 @@ gfc_resolve_aimag (gfc_expr * f, gfc_expr * x) void gfc_resolve_aint (gfc_expr * f, gfc_expr * a, gfc_expr * kind) { + gfc_typespec ts; + f->ts.type = a->ts.type; f->ts.kind = (kind == NULL) ? a->ts.kind : mpz_get_si (kind->value.integer); + if (a->ts.kind != f->ts.kind) + { + ts.type = f->ts.type; + ts.kind = f->ts.kind; + gfc_convert_type (a, &ts, 2); + } /* The resolved name is only used for specific intrinsics where the return kind is the same as the arg kind. */ f->value.function.name = @@ -143,9 +151,18 @@ gfc_resolve_all (gfc_expr * f, gfc_expr * mask, gfc_expr * dim) void gfc_resolve_anint (gfc_expr * f, gfc_expr * a, gfc_expr * kind) { + gfc_typespec ts; + f->ts.type = a->ts.type; f->ts.kind = (kind == NULL) ? a->ts.kind : mpz_get_si (kind->value.integer); + if (a->ts.kind != f->ts.kind) + { + ts.type = f->ts.type; + ts.kind = f->ts.kind; + gfc_convert_type (a, &ts, 2); + } + /* The resolved name is only used for specific intrinsics where the return kind is the same as the arg kind. */ f->value.function.name = |