aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2016-09-30 12:20:59 +0200
committerAndre Vehreschild <vehre@gcc.gnu.org>2016-09-30 12:20:59 +0200
commit26f391e8067e96e4fba7b531eda9fb80023f2fd2 (patch)
tree2a9fff47c877e59328ae314ee6f4aa5be68ce12a /gcc/fortran/trans-array.c
parentfa16a27195c8862806f1483026fa1fbba8315afb (diff)
downloadgcc-26f391e8067e96e4fba7b531eda9fb80023f2fd2.zip
gcc-26f391e8067e96e4fba7b531eda9fb80023f2fd2.tar.gz
gcc-26f391e8067e96e4fba7b531eda9fb80023f2fd2.tar.bz2
trans-array.c (gfc_array_allocate): Use the token from coarray's .token member.
gcc/fortran/ChangeLog: 2016-09-30 Andre Vehreschild <vehre@gcc.gnu.org> * trans-array.c (gfc_array_allocate): Use the token from coarray's .token member. * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Only generate caf-reference chains from the first coarray references on. * trans-types.c (gfc_get_derived_type): Switch on mandatory .token member generation for allocatable arrays in coarrays in derived types. gcc/testsuite/ChangeLog: 2016-09-30 Andre Vehreschild <vehre@gcc.gnu.org> * gfortran.dg/coarray_allocate_10.f08: New test. * gfortran.dg/coindexed_1.f90: Above fixes allow execution. From-SVN: r240650
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 0b97760..50312fe 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5406,7 +5406,6 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
gfc_expr **lower;
gfc_expr **upper;
gfc_ref *ref, *prev_ref = NULL, *coref;
- gfc_se caf_se;
bool allocatable, coarray, dimension, alloc_w_e3_arr_spec = false;
ref = expr->ref;
@@ -5531,7 +5530,6 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
}
}
- gfc_init_se (&caf_se, NULL);
gfc_start_block (&elseblock);
/* Allocate memory to store the data. */
@@ -5543,9 +5541,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
if (coarray && flag_coarray == GFC_FCOARRAY_LIB)
{
- tmp = gfc_get_tree_for_caf_expr (expr);
- gfc_get_caf_token_offset (&caf_se, &token, NULL, tmp, NULL_TREE, expr);
- gfc_add_block_to_block (&elseblock, &caf_se.pre);
+ token = gfc_conv_descriptor_token (se->expr);
token = gfc_build_addr_expr (NULL_TREE, token);
}
@@ -5557,7 +5553,6 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
else
gfc_allocate_using_malloc (&elseblock, pointer, size, status);
- gfc_add_block_to_block (&elseblock, &caf_se.post);
if (dimension)
{
cond = gfc_unlikely (fold_build2_loc (input_location, NE_EXPR,