diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-07-26 09:30:37 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-07-26 09:30:37 +0200 |
commit | af232d48a7e011bf85d12634644ce80c1ad6480d (patch) | |
tree | 7605607503ae92b280d32db1d07f72f9865b92a5 /gcc/fortran/trans-array.c | |
parent | 335d2e3964ccd360d718bbad6c9ff616acf8e65a (diff) | |
download | gcc-af232d48a7e011bf85d12634644ce80c1ad6480d.zip gcc-af232d48a7e011bf85d12634644ce80c1ad6480d.tar.gz gcc-af232d48a7e011bf85d12634644ce80c1ad6480d.tar.bz2 |
trans-array.c (CAF_TOKEN_FIELD): New macro constant.
2011-07-26 Tobias Burnus <burnus@net-b.de>
* trans-array.c (CAF_TOKEN_FIELD): New macro constant.
(gfc_conv_descriptor_token): New function.
* trans-array.h (gfc_conv_descriptor_token): New prototype.
* trans-types.c (gfc_get_array_descriptor_base): For coarrays
with -fcoarray=lib, append "void *token" to the array descriptor.
(gfc_array_descriptor_base_caf): New static variable.
* trans-expr.c (gfc_conv_procedure_call): Handle token and
* offset
when passing a descriptor coarray to a nondescriptor dummy.
2011-07-26 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_lib_token_2.f90: New.
From-SVN: r176784
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index b959b36..ff059a3 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -129,6 +129,7 @@ gfc_array_dataptr_type (tree desc) #define OFFSET_FIELD 1 #define DTYPE_FIELD 2 #define DIMENSION_FIELD 3 +#define CAF_TOKEN_FIELD 4 #define STRIDE_SUBFIELD 0 #define LBOUND_SUBFIELD 1 @@ -267,6 +268,24 @@ gfc_conv_descriptor_dimension (tree desc, tree dim) return tmp; } + +tree +gfc_conv_descriptor_token (tree desc) +{ + tree type; + tree field; + + type = TREE_TYPE (desc); + gcc_assert (GFC_DESCRIPTOR_TYPE_P (type)); + gcc_assert (gfc_option.coarray == GFC_FCOARRAY_LIB); + field = gfc_advance_chain (TYPE_FIELDS (type), CAF_TOKEN_FIELD); + gcc_assert (field != NULL_TREE && TREE_TYPE (field) == prvoid_type_node); + + return fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (field), + desc, field, NULL_TREE); +} + + static tree gfc_conv_descriptor_stride (tree desc, tree dim) { @@ -429,6 +448,7 @@ gfc_conv_shift_descriptor_lbound (stmtblock_t* block, tree desc, #undef OFFSET_FIELD #undef DTYPE_FIELD #undef DIMENSION_FIELD +#undef CAF_TOKEN_FIELD #undef STRIDE_SUBFIELD #undef LBOUND_SUBFIELD #undef UBOUND_SUBFIELD |