aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/trans-array.c2
-rw-r--r--gcc/fortran/trans-decl.c11
-rw-r--r--gcc/testsuite/gfortran.dg/caf-shared/cas.exp2
-rw-r--r--libgfortran/caf_shared/util.h4
4 files changed, 13 insertions, 6 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 35afff5..58aaa5f 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -3935,7 +3935,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr,
/* Early return - only taken for ALLOCATED for shared coarrays.
FIXME - this could probably be done more elegantly. */
- if (se->address_only)
+ if (flag_coarray == GFC_FCOARRAY_SHARED && ar->codimen && se->address_only)
{
se->expr = build_array_ref (se->expr, build_int_cst (TREE_TYPE (offset), 0),
decl, se->class_vptr);
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index f3526db..ab2725c 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3736,8 +3736,11 @@ gfc_build_intrinsic_function_decls (void)
void
gfc_build_builtin_function_decls (void)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
+ tree gfc_pint4_type_node = build_pointer_type (gfc_int4_type_node);
tree gfc_int8_type_node = gfc_get_int_type (8);
tree pint_type = build_pointer_type (integer_type_node);
+ tree pchar1_type_node = gfc_get_pchar_type (1);
gfor_fndecl_stop_numeric = gfc_build_library_function_decl (
get_identifier (PREFIX("stop_numeric")),
@@ -4123,8 +4126,8 @@ gfc_build_builtin_function_decls (void)
size_type_node, /* elem_size. */
integer_type_node, /* corank. */
integer_type_node, /* alloc_type. */
- pvoid_type_node, /* stat. */
- pvoid_type_node, /* errmsg. */
+ gfc_pint4_type_node, /* stat. */
+ pchar1_type_node, /* errmsg. */
gfc_charlen_type_node, /* errmsg_len. */
NULL_TREE);
gfor_fndecl_cas_coarray_free = gfc_build_library_function_decl_with_spec (
@@ -4697,8 +4700,8 @@ gfc_trans_shared_coarray (stmtblock_t * init, stmtblock_t *cleanup, gfc_symbol *
NULL_TREE, true, NULL, &element_size);
elem_size = size_in_bytes (gfc_get_element_type (TREE_TYPE(decl)));
gfc_allocate_shared_coarray (init, decl, elem_size, sym->as->rank,
- sym->as->corank, alloc_type, null_pointer_node,
- null_pointer_node,
+ sym->as->corank, alloc_type,
+ NULL_TREE, NULL_TREE,
build_int_cst (gfc_charlen_type_node, 0),
false);
gfc_conv_descriptor_offset_set (init, decl, offset);
diff --git a/gcc/testsuite/gfortran.dg/caf-shared/cas.exp b/gcc/testsuite/gfortran.dg/caf-shared/cas.exp
index 86e6b97..8f73bf2 100644
--- a/gcc/testsuite/gfortran.dg/caf-shared/cas.exp
+++ b/gcc/testsuite/gfortran.dg/caf-shared/cas.exp
@@ -47,7 +47,7 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]]
if ![runtest_file_p $runtests $test] then {
continue
}
- set option_list [list { -O2 } ]
+ set option_list [list { -g -O2 } ]
set nshort [file tail [file dirname $test]]/[file tail $test]
list-module-names $test
diff --git a/libgfortran/caf_shared/util.h b/libgfortran/caf_shared/util.h
index fa9e158..6ae3778 100644
--- a/libgfortran/caf_shared/util.h
+++ b/libgfortran/caf_shared/util.h
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <pthread.h>
#include <limits.h>
#include <assert.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define CAS_DEBUG_PR(str, ...) dprintf(2, "Image %d (pid %ld):\t" str "\n", this_image.image_num, (unsigned long) getpid(), ##__VA_ARGS__)
#define PTR_BITS (CHAR_BIT*sizeof(void *))