Compiling Fortran code with the ptx backend I'm working on results in assembler warnings about mismatch between function calls and function decls. This seems to be a bug in the Fortran frontend, where a decl for _gfortran_caf_init is created with four arguments, while the library function is declared as

_gfortran_caf_init (int *argc, char ***argv)

and calls to it are constructed (in create_main_function) with only two arguments.

Bootstrapped and tested on x86_64-linux. Ok?


Bernd
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 4a5ba1d..db46858 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3260,7 +3260,7 @@ gfc_build_builtin_function_decls (void)
 
       gfor_fndecl_caf_init = gfc_build_library_function_decl (
 		   get_identifier (PREFIX("caf_init")),  void_type_node,
-		   4, pint_type, pppchar_type, pint_type, pint_type);
+		   2, pint_type, pppchar_type);
 
       gfor_fndecl_caf_finalize = gfc_build_library_function_decl (
 	get_identifier (PREFIX("caf_finalize")), void_type_node, 0);

Reply via email to