diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-08-02 20:07:52 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-08-02 20:07:52 +0200 |
commit | 979d459888df360b584c17ca72d7a9b76fe50f52 (patch) | |
tree | 18f1e855d9cadeafb7016da5743be4dea9d4a5b2 /gcc/fortran/trans.c | |
parent | b7cef5958d61773228556bc68e4eacc90ce28672 (diff) | |
download | gcc-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.c')
-rw-r--r-- | gcc/fortran/trans.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 19f215c..4c97cfd 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -635,19 +635,21 @@ gfc_allocate_using_malloc (stmtblock_t * block, tree pointer, This function follows the following pseudo-code: void * - allocate (size_t size, integer_type stat) + allocate (size_t size, void** token, int *stat, char* errmsg, int errlen) { void *newmem; - - newmem = _caf_register ( size, regtype, NULL, &stat, NULL, NULL); + + newmem = _caf_register (size, regtype, token, &stat, errmsg, errlen); return newmem; } */ -void +static void gfc_allocate_using_lib (stmtblock_t * block, tree pointer, tree size, - tree status, tree errmsg, tree errlen) + tree token, tree status, tree errmsg, tree errlen) { tree tmp, pstat; + gcc_assert (token != NULL_TREE); + /* Evaluate size only once, and make sure it has the right type. */ size = gfc_evaluate_now (size, block); if (TREE_TYPE (size) != TREE_TYPE (size_type_node)) @@ -673,8 +675,7 @@ gfc_allocate_using_lib (stmtblock_t * block, tree pointer, tree size, build_int_cst (size_type_node, 1)), build_int_cst (integer_type_node, GFC_CAF_COARRAY_ALLOC), - null_pointer_node, /* token */ - pstat, errmsg, errlen); + token, pstat, errmsg, errlen); tmp = fold_build2_loc (input_location, MODIFY_EXPR, TREE_TYPE (pointer), pointer, @@ -706,8 +707,8 @@ gfc_allocate_using_lib (stmtblock_t * block, tree pointer, tree size, expr must be set to the original expression being allocated for its locus and variable name in case a runtime error has to be printed. */ void -gfc_allocate_allocatable (stmtblock_t * block, tree mem, tree size, tree status, - tree errmsg, tree errlen, gfc_expr* expr) +gfc_allocate_allocatable (stmtblock_t * block, tree mem, tree size, tree token, + tree status, tree errmsg, tree errlen, gfc_expr* expr) { stmtblock_t alloc_block; tree tmp, null_mem, alloc, error; @@ -726,7 +727,7 @@ gfc_allocate_allocatable (stmtblock_t * block, tree mem, tree size, tree status, if (gfc_option.coarray == GFC_FCOARRAY_LIB && gfc_expr_attr (expr).codimension) - gfc_allocate_using_lib (&alloc_block, mem, size, status, + gfc_allocate_using_lib (&alloc_block, mem, size, token, status, errmsg, errlen); else gfc_allocate_using_malloc (&alloc_block, mem, size, status); |