This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran, committed] (-fcoarray=lib) Change type of second argument to _gfortran_caf_num_images


This patch changes the type of second argument to _gfortran_caf_num_images from Boolean to integer. The reason is that we have to represent three different states: a) num_images() - all existing images (in the current/"distance"-th parent team)
b/c) num_images(...,failed) - those states which have/have not failed.

Thus, a Boolean is not sufficient. I knew that there must have been a reason that I used "int" and not "bool" on the branch. After re-reading the API documentation, I also know why ... (trans-intrinsic.c already uses int.)

Committed as Rev. 210311 after regtesting on x86-64-gnu-linux, which showed as only failure gfortran.dg/wextra_1.f (known problem).

Tobias
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 210310)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@
+2014-05-11  Tobias Burnus  <burnus@net-b.de>
+
+	* trans-intrinsic.c (gfc_build_builtin_function_decls):
+	Change type of second argument to int.
+
 2014-05-09  Mike Stump  <mikestump@comcast.net>
 
 	PR fortran/61109
Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c	(Revision 210310)
+++ gcc/fortran/trans-decl.c	(Arbeitskopie)
@@ -3264,7 +3264,7 @@ gfc_build_builtin_function_decls (void)
 
       gfor_fndecl_caf_num_images = gfc_build_library_function_decl (
 		   get_identifier (PREFIX("caf_num_images")), integer_type_node,
-		   2, integer_type_node, boolean_type_node);
+		   2, integer_type_node, integer_type_node);
 
       gfor_fndecl_caf_register = gfc_build_library_function_decl_with_spec (
 	get_identifier (PREFIX("caf_register")), "...WWW", pvoid_type_node, 6,
Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog	(Revision 210310)
+++ libgfortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,10 @@
+2014-05-11  Tobias Burnus  <burnus@net-b.de>
+
+	* caf/libcaf.h (_gfortran_caf_num_images): Change type of
+	second argument to int.
+	* caf/mpi.c (_gfortran_caf_num_images): Ditto.
+	* caf/single.c (_gfortran_caf_num_images): Ditto.
+
 2014-05-08  Tobias Burnus  <burnus@net-b.de>
 
 	* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
Index: libgfortran/caf/libcaf.h
===================================================================
--- libgfortran/caf/libcaf.h	(Revision 210310)
+++ libgfortran/caf/libcaf.h	(Arbeitskopie)
@@ -81,7 +81,7 @@ void _gfortran_caf_init (int *, char ***);
 void _gfortran_caf_finalize (void);
 
 int _gfortran_caf_this_image (int);
-int _gfortran_caf_num_images (int, bool);
+int _gfortran_caf_num_images (int, int);
 
 void *_gfortran_caf_register (size_t, caf_register_t, caf_token_t *, int *,
 			      char *, int);
Index: libgfortran/caf/mpi.c
===================================================================
--- libgfortran/caf/mpi.c	(Revision 210310)
+++ libgfortran/caf/mpi.c	(Arbeitskopie)
@@ -123,7 +123,7 @@ _gfortran_caf_this_image (int distance __attribute
 
 int
 _gfortran_caf_num_images (int distance __attribute__ ((unused)),
-			  bool failed __attribute__ ((unused)))
+			  int failed __attribute__ ((unused)))
 {
   return caf_num_images;
 }
Index: libgfortran/caf/single.c
===================================================================
--- libgfortran/caf/single.c	(Revision 210310)
+++ libgfortran/caf/single.c	(Arbeitskopie)
@@ -87,7 +87,7 @@ _gfortran_caf_this_image (int distance __attribute
 
 int
 _gfortran_caf_num_images (int distance __attribute__ ((unused)),
-			  bool failed __attribute__ ((unused)))
+			  int failed __attribute__ ((unused)))
 {
   return 1;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]