diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-09-21 21:50:36 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2020-09-21 21:50:36 +0200 |
commit | 5c5ce6099082b642294091c83461c928bd028ea1 (patch) | |
tree | 03fa12b75d3c0a820e83d45d9a270a832f3fb347 /gcc/fortran/iresolve.c | |
parent | 762c16eba6b815090c56564a293cd059aea2e1d6 (diff) | |
download | gcc-5c5ce6099082b642294091c83461c928bd028ea1.zip gcc-5c5ce6099082b642294091c83461c928bd028ea1.tar.gz gcc-5c5ce6099082b642294091c83461c928bd028ea1.tar.bz2 |
PR fortran/90903 [part2] - Add runtime checking for the MVBITS intrinsic
Implement inline expansion of the intrinsic elemental subroutine MVBITS
with optional runtime checks for valid argument range.
gcc/fortran/ChangeLog:
* iresolve.c (gfc_resolve_mvbits): Remove unneeded conversion of
FROMPOS, LEN and TOPOS arguments to fit a C int.
* trans-intrinsic.c (gfc_conv_intrinsic_mvbits): Add inline
expansion of MVBITS intrinsic elemental subroutine and add code
for runtime argument checking.
(gfc_conv_intrinsic_subroutine): Recognise MVBITS intrinsic, but
defer handling to gfc_trans_call.
* trans-stmt.c (replace_ss):
(gfc_trans_call): Adjust to handle inline expansion, scalarization
of intrinsic subroutine MVBITS in gfc_conv_intrinsic_mvbits.
* trans.h (gfc_conv_intrinsic_mvbits): Add prototype for
gfc_conv_intrinsic_mvbits.
gcc/testsuite/ChangeLog:
* gfortran.dg/check_bits_2.f90: New test.
Co-authored-by: Paul Thomas <pault@gcc.gnu.org>
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 7376961..c2a4865 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -3311,21 +3311,7 @@ gfc_resolve_mvbits (gfc_code *c) { static const sym_intent INTENTS[] = {INTENT_IN, INTENT_IN, INTENT_IN, INTENT_INOUT, INTENT_IN}; - const char *name; - gfc_typespec ts; - gfc_clear_ts (&ts); - - /* FROMPOS, LEN and TOPOS are restricted to small values. As such, - they will be converted so that they fit into a C int. */ - ts.type = BT_INTEGER; - ts.kind = gfc_c_int_kind; - if (c->ext.actual->next->expr->ts.kind != gfc_c_int_kind) - gfc_convert_type (c->ext.actual->next->expr, &ts, 2); - if (c->ext.actual->next->next->expr->ts.kind != gfc_c_int_kind) - gfc_convert_type (c->ext.actual->next->next->expr, &ts, 2); - if (c->ext.actual->next->next->next->next->expr->ts.kind != gfc_c_int_kind) - gfc_convert_type (c->ext.actual->next->next->next->next->expr, &ts, 2); /* TO and FROM are guaranteed to have the same kind parameter. */ name = gfc_get_string (PREFIX ("mvbits_i%d"), |