diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2019-07-07 10:53:37 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2019-07-07 10:53:37 +0000 |
commit | 94f3d11cfaa27dbac96f5edd48839b884a5c1ef5 (patch) | |
tree | f3d6715a580e9525bba4eb2b58abf27b1b9f7497 /gcc/fortran/trans-array.c | |
parent | 0b3839a4b267858948f0d2fe9ec600129d5d14b4 (diff) | |
download | gcc-94f3d11cfaa27dbac96f5edd48839b884a5c1ef5.zip gcc-94f3d11cfaa27dbac96f5edd48839b884a5c1ef5.tar.gz gcc-94f3d11cfaa27dbac96f5edd48839b884a5c1ef5.tar.bz2 |
re PR fortran/91077 (Wrong indexing when using a pointer)
2019-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/91077
* trans-array.c (gfc_conv_scalarized_array_ref) Delete code
that gave symbol backend decl for subref arrays and deferred
length variables.
2019-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/91077
* gfortran.dg/pointer_array_11.f90 : New test.
From-SVN: r273176
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1ab0361..c8d74e5 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3502,19 +3502,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) return; if (get_CFI_desc (NULL, expr, &decl, ar)) - { - decl = build_fold_indirect_ref_loc (input_location, decl); - goto done; - } - - if (expr && ((is_subref_array (expr) - && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (info->descriptor))) - || (expr->ts.deferred && (expr->expr_type == EXPR_VARIABLE - || expr->expr_type == EXPR_FUNCTION)))) - decl = expr->symtree->n.sym->backend_decl; - - if (decl && GFC_DECL_PTR_ARRAY_P (decl)) - goto done; + decl = build_fold_indirect_ref_loc (input_location, decl); /* A pointer array component can be detected from its field decl. Fix the descriptor, mark the resulting variable decl and pass it to @@ -3532,7 +3520,6 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) decl = info->descriptor; } -done: se->expr = gfc_build_array_ref (base, index, decl); } @@ -7865,7 +7852,7 @@ array_parameter_size (tree desc, gfc_expr *expr, tree *size) } /* Helper function - return true if the argument is a pointer. */ - + static bool is_pointer (gfc_expr *e) { |