summaryrefslogtreecommitdiff
path: root/gcc/fortran/iresolve.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-29 15:22:55 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-29 15:22:55 +0000
commit5ef4af82b73d491288c136102710a80b4b649cb9 (patch)
tree774547a136c573b57623fceaa8560b1cbbe1cd1b /gcc/fortran/iresolve.c
parent26dd65f35e0c4fc3724b5870bbaff6e4c4a81d44 (diff)
downloadgcc-5ef4af82b73d491288c136102710a80b4b649cb9.tar.gz
PR fortran/32989
* iresolve.c (gfc_resolve_getarg): Handle non-default integer kinds. * check.c (gfc_check_getarg): New function * intrinsic.h: Add prototype for gfc_check_getarg. * intrinsic.c (add_subroutines): Add reference to gfc_check_getarg. * intrinsic.texi (GETARG): Adjust documentation. * gfortran.fortran-torture/execute/getarg_1.f90: Add check for non-default integer kind arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127905 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r--gcc/fortran/iresolve.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 7948b14eeb9..73f5d73bc45 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -2675,9 +2675,18 @@ void
gfc_resolve_getarg (gfc_code *c)
{
const char *name;
- int kind;
- kind = gfc_default_integer_kind;
- name = gfc_get_string (PREFIX ("getarg_i%d"), kind);
+
+ if (c->ext.actual->expr->ts.kind != gfc_default_integer_kind)
+ {
+ gfc_typespec ts;
+
+ ts.type = BT_INTEGER;
+ ts.kind = gfc_default_integer_kind;
+
+ gfc_convert_type (c->ext.actual->expr, &ts, 2);
+ }
+
+ name = gfc_get_string (PREFIX ("getarg_i%d"), gfc_default_integer_kind);
c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
}