diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-09 21:18:42 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-09 21:18:42 +0000 |
commit | d678a061a6f8aa28c05588bb5c4a3ffe6af495c9 (patch) | |
tree | 530c2e857eb28361de2db9d88b30a1ef04da4efb /gcc/fortran/trans-openmp.c | |
parent | add258d7ce0f3efd6b7c2c635cc9d20c77fc938b (diff) | |
download | gcc-d678a061a6f8aa28c05588bb5c4a3ffe6af495c9.tar.gz |
PR fortran/27916
* trans-openmp.c (gfc_omp_clause_default_ctor): New function.
* trans.h (gfc_omp_clause_default_ctor): New prototype.
* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): Define.
* testsuite/libgomp.fortran/pr27916-1.f90: New test.
* testsuite/libgomp.fortran/pr27916-2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index b7c6f9e3bfb..76124acfc30 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -94,6 +94,29 @@ gfc_omp_predetermined_sharing (tree decl) return OMP_CLAUSE_DEFAULT_UNSPECIFIED; } + +/* Return code to initialize DECL with its default constructor, or + NULL if there's nothing to do. */ + +tree +gfc_omp_clause_default_ctor (tree clause ATTRIBUTE_UNUSED, tree decl) +{ + tree type = TREE_TYPE (decl); + stmtblock_t block; + + if (! GFC_DESCRIPTOR_TYPE_P (type)) + return NULL; + + /* Allocatable arrays in PRIVATE clauses need to be set to + "not currently allocated" allocation status. */ + gfc_init_block (&block); + + gfc_conv_descriptor_data_set (&block, decl, null_pointer_node); + + return gfc_finish_block (&block); +} + + /* Return true if DECL's DECL_VALUE_EXPR (if any) should be disregarded in OpenMP construct, because it is going to be remapped during OpenMP lowering. SHARED is true if DECL |