aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-08-02 20:07:52 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-08-02 20:07:52 +0200
commit979d459888df360b584c17ca72d7a9b76fe50f52 (patch)
tree18f1e855d9cadeafb7016da5743be4dea9d4a5b2 /gcc/fortran/trans-array.c
parentb7cef5958d61773228556bc68e4eacc90ce28672 (diff)
downloadgcc-979d459888df360b584c17ca72d7a9b76fe50f52.zip
gcc-979d459888df360b584c17ca72d7a9b76fe50f52.tar.gz
gcc-979d459888df360b584c17ca72d7a9b76fe50f52.tar.bz2
trans-array.c (gfc_array_allocate): Pass token to gfc_allocate_allocatable for -fcoarray=lib.
2011-08-02 Tobias Burnus <burnus@net-b.de> * trans-array.c (gfc_array_allocate): Pass token to gfc_allocate_allocatable for -fcoarray=lib. * trans-stmt.c (gfc_trans_allocate): Update gfc_allocate_allocatable call. * trans.h (gfc_allocate_allocatable): Update prototype. (gfc_allocate_using_lib): Remove. * trans.c (gfc_allocate_using_lib): Make static, handle token. (gfc_allocate_allocatable): Ditto. 2011-08-02 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_3.f90: New. From-SVN: r177198
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index dc8fdb8..a151c56 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4409,6 +4409,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
tree tmp;
tree pointer;
tree offset = NULL_TREE;
+ tree token = NULL_TREE;
tree size;
tree msg;
tree error = NULL_TREE;
@@ -4521,9 +4522,13 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
pointer = gfc_conv_descriptor_data_get (se->expr);
STRIP_NOPS (pointer);
+ if (coarray && gfc_option.coarray == GFC_FCOARRAY_LIB)
+ token = gfc_build_addr_expr (NULL_TREE,
+ gfc_conv_descriptor_token (se->expr));
+
/* The allocatable variant takes the old pointer as first argument. */
if (allocatable)
- gfc_allocate_allocatable (&elseblock, pointer, size,
+ gfc_allocate_allocatable (&elseblock, pointer, size, token,
status, errmsg, errlen, expr);
else
gfc_allocate_using_malloc (&elseblock, pointer, size, status);