From 26f391e8067e96e4fba7b531eda9fb80023f2fd2 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Fri, 30 Sep 2016 12:20:59 +0200 Subject: trans-array.c (gfc_array_allocate): Use the token from coarray's .token member. gcc/fortran/ChangeLog: 2016-09-30 Andre Vehreschild * 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 * gfortran.dg/coarray_allocate_10.f08: New test. * gfortran.dg/coindexed_1.f90: Above fixes allow execution. From-SVN: r240650 --- gcc/fortran/trans-array.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gcc/fortran/trans-array.c') 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, -- cgit v1.1