diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-06-10 15:31:42 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-06-10 15:31:42 +0000 |
commit | 980fa45eefc0ec8f71e1947a28938af28f6fdbb2 (patch) | |
tree | 6beac9da84a5344f39428891e904a85f281417f0 /gcc/fortran/trans-array.c | |
parent | dcdae924d27a737dcda16bac7d9dfad5fbdfba6a (diff) | |
download | gcc-980fa45eefc0ec8f71e1947a28938af28f6fdbb2.zip gcc-980fa45eefc0ec8f71e1947a28938af28f6fdbb2.tar.gz gcc-980fa45eefc0ec8f71e1947a28938af28f6fdbb2.tar.bz2 |
gfortran.h (gfc_expr): Add no_bounds_check field.
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.h (gfc_expr): Add no_bounds_check field.
* frontend-passes.c (get_array_inq_function): Set no_bounds_check
on function and function argument.
(inline_matmul_assign): Set no_bounds_check on zero expression
and on lhs of zero expression.
Also handle A1B2 case if realloc on assigment is active.
* trans-array.c (gfc_conv_array_ref): Don't do range checking
if expr has no_bounds_check set.
(gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
has it set.
* trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
on lss and lss if the corresponding expressions have it set.
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.dg/inline_matmul_23.f90: New test.
From-SVN: r261388
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 97c4725..193411c 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3583,7 +3583,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr, gfc_conv_expr_type (&indexse, ar->start[n], gfc_array_index_type); gfc_add_block_to_block (&se->pre, &indexse.pre); - if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) + if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) && ! expr->no_bounds_check) { /* Check array bounds. */ tree cond; @@ -7181,6 +7181,9 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) /* The right-hand side of a pointer assignment mustn't use a temporary. */ gcc_assert (!se->direct_byref); + /* Do we need bounds checking or not? */ + ss->no_bounds_check = expr->no_bounds_check; + /* Setup the scalarizing loops and bounds. */ gfc_conv_ss_startstride (&loop); |