diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-09-28 22:29:56 +0200 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-09-28 22:29:56 +0200 |
commit | 786773d4c12fd78e94f58193ff303cba19ca1b19 (patch) | |
tree | 9292ff99082d665b9c07e8220fa7f16b9aa96030 /gcc/fortran/iresolve.cc | |
parent | 1c928004cf0bc2131b6199905d11133d23a7cef2 (diff) | |
download | gcc-786773d4c12fd78e94f58193ff303cba19ca1b19.zip gcc-786773d4c12fd78e94f58193ff303cba19ca1b19.tar.gz gcc-786773d4c12fd78e94f58193ff303cba19ca1b19.tar.bz2 |
Implement FINDLOC for UNSIGNED.
gcc/fortran/ChangeLog:
* check.cc (intrinsic_type_check): Handle unsigned.
(gfc_check_findloc): Likewise.
* gfortran.texi: Include FINDLOC in unsigned documentation.
* iresolve.cc (gfc_resolve_findloc): Use INTEGER version
for UNSIGNED.
gcc/testsuite/ChangeLog:
* gfortran.dg/unsigned_33.f90: New test.
Diffstat (limited to 'gcc/fortran/iresolve.cc')
-rw-r--r-- | gcc/fortran/iresolve.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/iresolve.cc b/gcc/fortran/iresolve.cc index 5a1e0a6..9fb2212 100644 --- a/gcc/fortran/iresolve.cc +++ b/gcc/fortran/iresolve.cc @@ -1819,6 +1819,7 @@ gfc_resolve_findloc (gfc_expr *f, gfc_expr *array, gfc_expr *value, int i, j, idim; int fkind; int d_num; + bt type; /* See at the end of the function for why this is necessary. */ @@ -1897,9 +1898,15 @@ gfc_resolve_findloc (gfc_expr *f, gfc_expr *array, gfc_expr *value, gfc_convert_type_warn (back, &ts, 2, 0); } + /* Use the INTEGER library function for UNSIGNED. */ + if (array->ts.type != BT_UNSIGNED) + type = array->ts.type; + else + type = BT_INTEGER; + f->value.function.name = gfc_get_string (PREFIX ("%s%d_%c%d"), name, d_num, - gfc_type_letter (array->ts.type, true), + gfc_type_letter (type, true), gfc_type_abi_kind (&array->ts)); /* We only have a single library function, so we need to convert |