]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix errors introduced by last commit.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 27 Dec 2020 15:31:33 +0000 (16:31 +0100)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 27 Dec 2020 15:31:33 +0000 (16:31 +0100)
gcc/fortran/ChangeLog:

* trans-array.c (gfc_conv_array_ref): Before discarding offset,
check if this is a coarray and we are building shared coarrays.
* trans-decl.c (gfc_build_builtin_function_decls): Clear up
types for cas_coarray_allocate.
(gfc_trans_shared_coarray): Pass NULL_TREEs to status and
errmsg.

libgfortran/ChangeLog:

* caf_shared/util.h (CAS_DEBUG_PR): New macro.

gcc/testsuite/ChangeLog:

* gfortran.dg/caf-shared/cas.exp: Add -g to debug flags to allow
better backtrace.

gcc/fortran/trans-array.c
gcc/fortran/trans-decl.c
gcc/testsuite/gfortran.dg/caf-shared/cas.exp
libgfortran/caf_shared/util.h

index 35afff5845e537d68aa3f199e849e6055f6617bc..58aaa5f781d95ba0fbbe12b8db7ae205f644f93e 100644 (file)
@@ -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);
index f3526db7ea6371bb9602ed28c5b94c69fc50afa0..ab2725ca6f182d020a9c3c9211563066d41981a0 100644 (file)
@@ -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);
index 86e6b97090b54ff5a9cbec78d9a1441517d49c7a..8f73bf24b88b414629fe1fb3987f5a352edbc68f 100644 (file)
@@ -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
index fa9e158b38f9b681dc3d4f64b83314b417ec7a98..6ae37780fb48307d5a301a4528152d219ecefa6b 100644 (file)
@@ -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 *))