Fix fortran size_type_node parameter passing.
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 22 May 2019 13:12:03 +0000 (13:12 +0000)
committerAndrew Stubbs <ams@gcc.gnu.org>
Wed, 22 May 2019 13:12:03 +0000 (13:12 +0000)
2019-05-22  Andrew Stubbs  <ams@codesourcery.com>

gcc/fortran/
* trans-stmt.c (gfc_trans_critical): Use size_type_node for
gfor_fndecl_caf_lock and gfor_fndecl_caf_unlock calls.
(gfc_trans_allocate): Use size_type_node for gfor_fndecl_caf_sync_all
call.

From-SVN: r271512

gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c

index f119e748bf84bd3e341da8d079364279fd76480f..c3240f44e8d48e22af17a1edf8fba5d615c0afee 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-22  Andrew Stubbs  <ams@codesourcery.com>
+
+       * trans-stmt.c (gfc_trans_critical): Use size_type_node for
+       gfor_fndecl_caf_lock and gfor_fndecl_caf_unlock calls.
+       (gfc_trans_allocate): Use size_type_node for gfor_fndecl_caf_sync_all
+       call.
+
 2019-05-22  Jeff Law  <law@redhat.com>
            Mark Eggleston  <mark.eggleston@codethink.com>
 
index 5fa182bf05a936116d9b5105954072754c87d891..7c36563408564677c30dafbe0674806a9dd04255 100644 (file)
@@ -1576,12 +1576,13 @@ gfc_trans_critical (gfc_code *code)
 
   if (flag_coarray == GFC_FCOARRAY_LIB)
     {
+      tree zero_size = build_zero_cst (size_type_node);
       token = gfc_get_symbol_decl (code->resolved_sym);
       token = GFC_TYPE_ARRAY_CAF_TOKEN (TREE_TYPE (token));
       tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_lock, 7,
-                                token, integer_zero_node, integer_one_node,
+                                token, zero_size, integer_one_node,
                                 null_pointer_node, null_pointer_node,
-                                null_pointer_node, integer_zero_node);
+                                null_pointer_node, zero_size);
       gfc_add_expr_to_block (&block, tmp);
 
       /* It guarantees memory consistency within the same segment */
@@ -1601,10 +1602,11 @@ gfc_trans_critical (gfc_code *code)
 
   if (flag_coarray == GFC_FCOARRAY_LIB)
     {
+      tree zero_size = build_zero_cst (size_type_node);
       tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_unlock, 6,
-                                token, integer_zero_node, integer_one_node,
+                                token, zero_size, integer_one_node,
                                 null_pointer_node, null_pointer_node,
-                                integer_zero_node);
+                                zero_size);
       gfc_add_expr_to_block (&block, tmp);
 
       /* It guarantees memory consistency within the same segment */
@@ -6772,9 +6774,10 @@ gfc_trans_allocate (gfc_code * code)
   if (needs_caf_sync)
     {
       /* Add a sync all after the allocation has been executed.  */
+      tree zero_size = build_zero_cst (size_type_node);
       tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_sync_all,
                                 3, null_pointer_node, null_pointer_node,
-                                integer_zero_node);
+                                zero_size);
       gfc_add_expr_to_block (&post, tmp);
     }