diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-06 22:29:24 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-06 22:29:24 +0000 |
commit | 736f21d6204d06894dc6e22e3d6a236581d60471 (patch) | |
tree | 98d4f465366ad44d857ca6bf554c6e61a154c902 /gcc/fortran/iresolve.c | |
parent | e9e59fb8396c5fffe97c37a9f9c555733c36a78b (diff) | |
download | gcc-736f21d6204d06894dc6e22e3d6a236581d60471.tar.gz |
PR fortran/30933
* iresolve.c (gfc_resolve_exit): Convert argument to default
integer kind.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127256 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 5c491355908..21ec6058a10 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -2739,14 +2739,18 @@ void gfc_resolve_exit (gfc_code *c) { const char *name; - int kind; + gfc_typespec ts; + gfc_expr *n; - if (c->ext.actual->expr != NULL) - kind = c->ext.actual->expr->ts.kind; - else - kind = gfc_default_integer_kind; + /* The STATUS argument has to be of default kind. If it is not, + we convert it. */ + ts.type = BT_INTEGER; + ts.kind = gfc_default_integer_kind; + n = c->ext.actual->expr; + if (n != NULL && n->ts.kind != ts.kind) + gfc_convert_type (n, &ts, 2); - name = gfc_get_string (PREFIX ("exit_i%d"), kind); + name = gfc_get_string (PREFIX ("exit_i%d"), ts.kind); c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); } |