Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-10-15 Thread Jan Hubicka
> Hi Honza,
> 
> attached is the patch to fix the fnspec-strings for the caf-api. I have tested
> it and got no regressions with gcc-testsuite and with the opencoarray's
> testsuite. So that seems fine. Hope this helps and again thank you for your
> instant support on IRC.

Thanks a lot for fixing this! Once the patch is in, I will enable the
verifier.  (and most of support was done by Richi anyway :)

Honza
> 
> Regards,
>   Andre
> 
> On Wed, 7 Oct 2020 13:28:56 +0200
> Tobias Burnus  wrote:
> 
> > Hi Andre,
> > 
> > On 10/7/20 12:21 PM, Andre Vehreschild wrote:
> > > I am confused. Given that on 2. Oct. 2020 you committed changes to the
> > > caf-fn_spec strings means: you don't need anymore help on this?  
> > 
> > Do you mean the change by the patch "Perforate fnspec attribute strings"?
> > (https://gcc.gnu.org/g:762cca0023c9bdbd762c44f33a954845bbccd568)
> > That one just added spaces for the updated fnspec format.
> > 
> > Otherwise:
> > See gcc/attr-fnspec.h for a description.
> > 
> > I suggest also to have a look at the commit log at
> > https://gcc.gnu.org/g:2595f25cdaf4f16d04a1078a487b2ecc126cae29
> > and at the PR https://gcc.gnu.org/PR92123 for gotchas.
> > 
> > Tobias
> > 
> > -
> > Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / 
> > Germany
> > Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung,
> > Alexander Walter
> 
> 
> -- 
> Andre Vehreschild * Email: vehre ad gmx dot de 

> diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
> index 5940a1fd10c..fca1622edd1 100644
> --- a/gcc/fortran/trans-decl.c
> +++ b/gcc/fortran/trans-decl.c
> @@ -3832,9 +3832,9 @@ gfc_build_builtin_function_decls (void)
>pppchar_type
>   = build_pointer_type (build_pointer_type (pchar_type_node));
> 
> -  gfor_fndecl_caf_init = gfc_build_library_function_decl (
> - get_identifier (PREFIX("caf_init")), void_type_node,
> - 2, pint_type, pppchar_type);
> +  gfor_fndecl_caf_init = gfc_build_library_function_decl_with_spec (
> + get_identifier (PREFIX("caf_init")), ". W W ",
> + void_type_node, 2, pint_type, pppchar_type);
> 
>gfor_fndecl_caf_finalize = gfc_build_library_function_decl (
>   get_identifier (PREFIX("caf_finalize")), void_type_node, 0);
> @@ -3848,47 +3848,47 @@ gfc_build_builtin_function_decls (void)
>   2, integer_type_node, integer_type_node);
> 
>gfor_fndecl_caf_register = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_register")), "R R W W W W R ",
> + get_identifier (PREFIX("caf_register")), ". . . W w w w . ",
>   void_type_node, 7,
>   size_type_node, integer_type_node, ppvoid_type_node, pvoid_type_node,
>   pint_type, pchar_type_node, size_type_node);
> 
>gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec 
> (
> - get_identifier (PREFIX("caf_deregister")), "W R W W R ",
> + get_identifier (PREFIX("caf_deregister")), ". W . w w . ",
>   void_type_node, 5,
>   ppvoid_type_node, integer_type_node, pint_type, pchar_type_node,
>   size_type_node);
> 
>gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_get")), ". R . R R W R R R W ",
> + get_identifier (PREFIX("caf_get")), ". r . . r r w . . . w ",
>   void_type_node, 10,
>   pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
>   pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
>   boolean_type_node, pint_type);
> 
>gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_send")), ". R . R R R R R R W R ",
> + get_identifier (PREFIX("caf_send")), ". r . . w r r . . . w ",
>   void_type_node, 11,
>   pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
>   pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
>   boolean_type_node, pint_type, pvoid_type_node);
> 
>gfor_fndecl_caf_sendget = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_sendget")), ". R . R R R R . R R R R R R ",
> + get_identifier (PREFIX("caf_sendget")), ". r . . w r r . . r r . . . w 
> ",
>   void_type_node, 14, pvoid_type_node, size_type_node, integer_type_node,
>   pvoid_type_node, pvoid_type_node, pvoid_type_node, size_type_node,
>   integer_type_node, pvoid_type_node, pvoid_type_node, integer_type_node,
>   integer_type_node, boolean_type_node, integer_type_node);
> 
>gfor_fndecl_caf_get_by_ref = gfc_build_library_function_decl_with_spec 
> (
> - get_identifier (PREFIX("caf_get_by_ref")), ". R W R R R R R W R ",
> + get_identifier (PREFIX("caf_get_by_ref")), ". r . w r . . . . w . ",
>   void_type_node,
>   10, pvoid_type_node, integer_type_node, pvoid_type_node,
>   pvoid_type_node, integer_type_node, integer_type_node,
>   

Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-10-15 Thread Andre Vehreschild
Hi Honza,

attached is the patch to fix the fnspec-strings for the caf-api. I have tested
it and got no regressions with gcc-testsuite and with the opencoarray's
testsuite. So that seems fine. Hope this helps and again thank you for your
instant support on IRC.

Regards,
Andre

On Wed, 7 Oct 2020 13:28:56 +0200
Tobias Burnus  wrote:

> Hi Andre,
> 
> On 10/7/20 12:21 PM, Andre Vehreschild wrote:
> > I am confused. Given that on 2. Oct. 2020 you committed changes to the
> > caf-fn_spec strings means: you don't need anymore help on this?  
> 
> Do you mean the change by the patch "Perforate fnspec attribute strings"?
> (https://gcc.gnu.org/g:762cca0023c9bdbd762c44f33a954845bbccd568)
> That one just added spaces for the updated fnspec format.
> 
> Otherwise:
> See gcc/attr-fnspec.h for a description.
> 
> I suggest also to have a look at the commit log at
> https://gcc.gnu.org/g:2595f25cdaf4f16d04a1078a487b2ecc126cae29
> and at the PR https://gcc.gnu.org/PR92123 for gotchas.
> 
> Tobias
> 
> -
> Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung,
> Alexander Walter


-- 
Andre Vehreschild * Email: vehre ad gmx dot de 
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 5940a1fd10c..fca1622edd1 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3832,9 +3832,9 @@ gfc_build_builtin_function_decls (void)
   pppchar_type
 	= build_pointer_type (build_pointer_type (pchar_type_node));

-  gfor_fndecl_caf_init = gfc_build_library_function_decl (
-	get_identifier (PREFIX("caf_init")), void_type_node,
-	2, pint_type, pppchar_type);
+  gfor_fndecl_caf_init = gfc_build_library_function_decl_with_spec (
+	get_identifier (PREFIX("caf_init")), ". W W ",
+	void_type_node, 2, pint_type, pppchar_type);

   gfor_fndecl_caf_finalize = gfc_build_library_function_decl (
 	get_identifier (PREFIX("caf_finalize")), void_type_node, 0);
@@ -3848,47 +3848,47 @@ gfc_build_builtin_function_decls (void)
 	2, integer_type_node, integer_type_node);

   gfor_fndecl_caf_register = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_register")), "R R W W W W R ",
+	get_identifier (PREFIX("caf_register")), ". . . W w w w . ",
 	void_type_node, 7,
 	size_type_node, integer_type_node, ppvoid_type_node, pvoid_type_node,
 	pint_type, pchar_type_node, size_type_node);

   gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_deregister")), "W R W W R ",
+	get_identifier (PREFIX("caf_deregister")), ". W . w w . ",
 	void_type_node, 5,
 	ppvoid_type_node, integer_type_node, pint_type, pchar_type_node,
 	size_type_node);

   gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_get")), ". R . R R W R R R W ",
+	get_identifier (PREFIX("caf_get")), ". r . . r r w . . . w ",
 	void_type_node, 10,
 	pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
 	pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
 	boolean_type_node, pint_type);

   gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_send")), ". R . R R R R R R W R ",
+	get_identifier (PREFIX("caf_send")), ". r . . w r r . . . w ",
 	void_type_node, 11,
 	pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
 	pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
 	boolean_type_node, pint_type, pvoid_type_node);

   gfor_fndecl_caf_sendget = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_sendget")), ". R . R R R R . R R R R R R ",
+	get_identifier (PREFIX("caf_sendget")), ". r . . w r r . . r r . . . w ",
 	void_type_node,	14, pvoid_type_node, size_type_node, integer_type_node,
 	pvoid_type_node, pvoid_type_node, pvoid_type_node, size_type_node,
 	integer_type_node, pvoid_type_node, pvoid_type_node, integer_type_node,
 	integer_type_node, boolean_type_node, integer_type_node);

   gfor_fndecl_caf_get_by_ref = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_get_by_ref")), ". R W R R R R R W R ",
+	get_identifier (PREFIX("caf_get_by_ref")), ". r . w r . . . . w . ",
 	void_type_node,
 	10, pvoid_type_node, integer_type_node, pvoid_type_node,
 	pvoid_type_node, integer_type_node, integer_type_node,
 	boolean_type_node, boolean_type_node, pint_type, integer_type_node);

   gfor_fndecl_caf_send_by_ref = gfc_build_library_function_decl_with_spec (
-	get_identifier (PREFIX("caf_send_by_ref")), ". R R R R R R R W R ",
+	get_identifier (PREFIX("caf_send_by_ref")), ". r . r r . . . . w . ",
 	void_type_node,	10, pvoid_type_node, integer_type_node, pvoid_type_node,
 	pvoid_type_node, integer_type_node, integer_type_node,
 	boolean_type_node, boolean_type_node, pint_type, integer_type_node);
@@ -3896,7 +3896,7 @@ 

Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-10-07 Thread Tobias Burnus

Hi Andre,

On 10/7/20 12:21 PM, Andre Vehreschild wrote:

I am confused. Given that on 2. Oct. 2020 you committed changes to the
caf-fn_spec strings means: you don't need anymore help on this?


Do you mean the change by the patch "Perforate fnspec attribute strings"?
(https://gcc.gnu.org/g:762cca0023c9bdbd762c44f33a954845bbccd568)
That one just added spaces for the updated fnspec format.

Otherwise:
See gcc/attr-fnspec.h for a description.

I suggest also to have a look at the commit log at
https://gcc.gnu.org/g:2595f25cdaf4f16d04a1078a487b2ecc126cae29
and at the PR https://gcc.gnu.org/PR92123 for gotchas.

Tobias

-
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter


Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-10-07 Thread Andre Vehreschild
Hi,

I am confused. Given that on 2. Oct. 2020 you committed changes to the
caf-fn_spec strings means: you don't need anymore help on this?

- Andre

On Wed, 30 Sep 2020 18:12:31 +0200
Jan Hubicka  wrote:

> Hi,
> this patch contains basic fixup of the fnspec strings for caf, however I
> am quite sure I need help on this (short of dropping them all).
>
> I first assumed that we have missing "." for return values since most
> strings had as many letters as parametrs, but it is not true.
> I tried to check the strings with reality. For example:
>
>
> void
> _gfortran_caf_co_sum (gfc_descriptor_t *a __attribute__ ((unused)),
> int result_image __attribute__ ((unused)),
>   int *stat, char *errmsg __attribute__ ((unused)),
> size_t errmsg_len __attribute__ ((unused)))
> {
> if (stat)
> *stat = 0;
> }
>
>
> Should have fnspec
>  ".XXWXX"
> First dot represents return value, then X is for unused parameters and W
> is for stat pointer we write into.
>
> However I am not sure why the pointers are part ofthe API, if they are
> meant to be used later, we need to specify them so things remain ABI
> compatible.
>
> It is declared as:
>   get_identifier (PREFIX("caf_co_sum")), "W.WW",
> Which correclty specifies stat as W, but I am not sure what does the
> else.
>
> I would apprechiate help from someone who knows the API to correct the
> strings.  Basicaly all strings starting with "W" or "R" are wrong since
> they miss the return value specifier.
>
> An alternative would be to simply drop all of those if we are unsure
> what they do, but it seems lame.
>
> Honza
>
> diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
> index 2be9df40d2c..59ea891915e 100644
> --- a/gcc/fortran/trans-decl.c
> +++ b/gcc/fortran/trans-decl.c
> @@ -3514,8 +3514,8 @@ gfc_build_intrinsic_function_decls (void)
>DECL_PURE_P (gfor_fndecl_si_kind) = 1;
>TREE_NOTHROW (gfor_fndecl_si_kind) = 1;
>
> -  gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("selected_real_kind2008")), ".RR",
> +  gfor_fndecl_sr_kind = gfc_build_library_function_decl (
> + get_identifier (PREFIX("selected_real_kind2008")),
>   gfc_int4_type_node, 3, pvoid_type_node, pvoid_type_node,
>   pvoid_type_node);
>DECL_PURE_P (gfor_fndecl_sr_kind) = 1;
> @@ -3841,50 +3841,50 @@ gfc_build_builtin_function_decls (void)
>   get_identifier (PREFIX("caf_num_images")), integer_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")), "RRR", void_type_node,
> 7,
> +  gfor_fndecl_caf_register = gfc_build_library_function_decl (
> + get_identifier (PREFIX("caf_register")), void_type_node, 7,
>   size_type_node, integer_type_node, ppvoid_type_node, pvoid_type_node,
>   pint_type, pchar_type_node, size_type_node);
>
>gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec
> (
> - get_identifier (PREFIX("caf_deregister")), "WRWWR", void_type_node,
> 5,
> + get_identifier (PREFIX("caf_deregister")), ".W.WW.", void_type_node,
> 5, ppvoid_type_node, integer_type_node, pint_type, pchar_type_node,
>   size_type_node);
>
> -  gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_get")), ".R.RRWRRRW", void_type_node, 10,
> +  gfor_fndecl_caf_get = gfc_build_library_function_decl (
> + get_identifier (PREFIX("caf_get")), void_type_node, 10,
>   pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
>   pvoid_type_node, pvoid_type_node, integer_type_node,
> integer_type_node, boolean_type_node, pint_type);
>
> -  gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_send")), ".R.RRWR", void_type_node,
> 11,
> +  gfor_fndecl_caf_send = gfc_build_library_function_decl (
> + get_identifier (PREFIX("caf_send")), void_type_node, 11,
>   pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
>   pvoid_type_node, pvoid_type_node, integer_type_node,
> integer_type_node, boolean_type_node, pint_type, pvoid_type_node);
>
> -  gfor_fndecl_caf_sendget = gfc_build_library_function_decl_with_spec (
> - get_identifier (PREFIX("caf_sendget")), ".R..RR",
> +  gfor_fndecl_caf_sendget = gfc_build_library_function_decl (
> + get_identifier (PREFIX("caf_sendget")),
>   void_type_node, 14, pvoid_type_node, size_type_node,
> integer_type_node, pvoid_type_node, pvoid_type_node, pvoid_type_node,
> size_type_node, integer_type_node, pvoid_type_node, pvoid_type_node,
> integer_type_node, integer_type_node, boolean_type_node, integer_type_node);
>
> -  gfor_fndecl_caf_get_by_ref = gfc_build_library_function_decl_with_spec
> (
> - get_identifier (PREFIX("caf_get_by_ref")), ".RWRWR",
> void_type_node,
> +  

Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-09-30 Thread Andre Vehreschild

Hi Honza, Tobias,
Yes, I am willing to help and will do so as soon as my small vacation ends
on Monday.

Regards,
Andre

Andre Vehreschild * ve...@gmx.de
Am 30. September 2020 19:12:48 schrieb Tobias Burnus :


Hi Honza,

On 9/30/20 6:12 PM, Jan Hubicka wrote:

_gfortran_caf_co_sum (gfc_descriptor_t *a __attribute__ ((unused)),

Should have fnspec
  ".XXWXX"
First dot represents return value, then X is for unused parameters


'X' is definitely wrong. In GCC there is only a stub implementation for
gfortran's coarray (Fortran) implemented. The full version needs
a communication library – such as MPI (Message Passing Interface)
or GASNet or OpenShMem ... Hence, that library is separate. The main point
of this stub library is to provide some means for testing.

See http://www.opencoarrays.org/ and
https://github.com/sourceryinstitute/opencoarrays/
for a (or rather: the) version which actually implements those
library functions.


I would apprechiate help from someone who knows the API to correct the
strings.


@Andre? How about you? ;-)


-  gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
- get_identifier (PREFIX("selected_real_kind2008")), ".RR",
+  gfor_fndecl_sr_kind = gfc_build_library_function_decl (
+ get_identifier (PREFIX("selected_real_kind2008")),


(This one is outside CAF.)

@Honza: I want to note that also for user functions, 'fn spec' are
generated, cf. create_fn_spec in trans-types.c – hopefully this one is fine.

Tobias

-
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung,
Alexander Walter




Re: libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-09-30 Thread Tobias Burnus

Hi Honza,

On 9/30/20 6:12 PM, Jan Hubicka wrote:

_gfortran_caf_co_sum (gfc_descriptor_t *a __attribute__ ((unused)),

Should have fnspec
  ".XXWXX"
First dot represents return value, then X is for unused parameters


'X' is definitely wrong. In GCC there is only a stub implementation for
gfortran's coarray (Fortran) implemented. The full version needs
a communication library – such as MPI (Message Passing Interface)
or GASNet or OpenShMem ... Hence, that library is separate. The main point
of this stub library is to provide some means for testing.

See http://www.opencoarrays.org/ and
https://github.com/sourceryinstitute/opencoarrays/
for a (or rather: the) version which actually implements those
library functions.


I would apprechiate help from someone who knows the API to correct the
strings.


@Andre? How about you? ;-)


-  gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
- get_identifier (PREFIX("selected_real_kind2008")), ".RR",
+  gfor_fndecl_sr_kind = gfc_build_library_function_decl (
+ get_identifier (PREFIX("selected_real_kind2008")),


(This one is outside CAF.)

@Honza: I want to note that also for user functions, 'fn spec' are
generated, cf. create_fn_spec in trans-types.c – hopefully this one is fine.

Tobias

-
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter


libgfortran caf API help needed: Fixing fnspec strings in trans-decl

2020-09-30 Thread Jan Hubicka
Hi,
this patch contains basic fixup of the fnspec strings for caf, however I
am quite sure I need help on this (short of dropping them all).

I first assumed that we have missing "." for return values since most
strings had as many letters as parametrs, but it is not true.
I tried to check the strings with reality. For example:


void
_gfortran_caf_co_sum (gfc_descriptor_t *a __attribute__ ((unused)), 
  int result_image __attribute__ ((unused)),
  int *stat, char *errmsg __attribute__ ((unused)), 
  size_t errmsg_len __attribute__ ((unused)))   
{   
  if (stat) 
*stat = 0;  
}   

Should have fnspec
 ".XXWXX"
First dot represents return value, then X is for unused parameters and W
is for stat pointer we write into.

However I am not sure why the pointers are part ofthe API, if they are
meant to be used later, we need to specify them so things remain ABI
compatible.

It is declared as:
get_identifier (PREFIX("caf_co_sum")), "W.WW",
Which correclty specifies stat as W, but I am not sure what does the
else.

I would apprechiate help from someone who knows the API to correct the
strings.  Basicaly all strings starting with "W" or "R" are wrong since
they miss the return value specifier.

An alternative would be to simply drop all of those if we are unsure
what they do, but it seems lame.

Honza

diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 2be9df40d2c..59ea891915e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3514,8 +3514,8 @@ gfc_build_intrinsic_function_decls (void)
   DECL_PURE_P (gfor_fndecl_si_kind) = 1;
   TREE_NOTHROW (gfor_fndecl_si_kind) = 1;
 
-  gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
-   get_identifier (PREFIX("selected_real_kind2008")), ".RR",
+  gfor_fndecl_sr_kind = gfc_build_library_function_decl (
+   get_identifier (PREFIX("selected_real_kind2008")),
gfc_int4_type_node, 3, pvoid_type_node, pvoid_type_node,
pvoid_type_node);
   DECL_PURE_P (gfor_fndecl_sr_kind) = 1;
@@ -3841,50 +3841,50 @@ gfc_build_builtin_function_decls (void)
get_identifier (PREFIX("caf_num_images")), integer_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")), "RRR", void_type_node, 7,
+  gfor_fndecl_caf_register = gfc_build_library_function_decl (
+   get_identifier (PREFIX("caf_register")), void_type_node, 7,
size_type_node, integer_type_node, ppvoid_type_node, pvoid_type_node,
pint_type, pchar_type_node, size_type_node);
 
   gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec (
-   get_identifier (PREFIX("caf_deregister")), "WRWWR", void_type_node, 5,
+   get_identifier (PREFIX("caf_deregister")), ".W.WW.", void_type_node, 5,
ppvoid_type_node, integer_type_node, pint_type, pchar_type_node,
size_type_node);
 
-  gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec (
-   get_identifier (PREFIX("caf_get")), ".R.RRWRRRW", void_type_node, 10,
+  gfor_fndecl_caf_get = gfc_build_library_function_decl (
+   get_identifier (PREFIX("caf_get")), void_type_node, 10,
pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
boolean_type_node, pint_type);
 
-  gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec (
-   get_identifier (PREFIX("caf_send")), ".R.RRWR", void_type_node, 11,
+  gfor_fndecl_caf_send = gfc_build_library_function_decl (
+   get_identifier (PREFIX("caf_send")), void_type_node, 11,
pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
boolean_type_node, pint_type, pvoid_type_node);
 
-  gfor_fndecl_caf_sendget = gfc_build_library_function_decl_with_spec (
-   get_identifier (PREFIX("caf_sendget")), ".R..RR",
+  gfor_fndecl_caf_sendget = gfc_build_library_function_decl (
+   get_identifier (PREFIX("caf_sendget")),
void_type_node, 14, pvoid_type_node, size_type_node, integer_type_node,
pvoid_type_node, pvoid_type_node, pvoid_type_node, size_type_node,
integer_type_node, pvoid_type_node, pvoid_type_node, integer_type_node,
integer_type_node, boolean_type_node, integer_type_node);
 
-