[gomp] Fix privatization of function result variable (both implicit and explicit)

Diego Novillo dnovillo@redhat.com
Mon Nov 7 17:12:00 GMT 2005


On Monday 07 November 2005 11:59, Jakub Jelinek wrote:

> 	* gimplify.c (omp_notice_variable): Call omp_predetermined_sharing
> 	langhook even for DECL_ARTIFICIAL.
> 	* langhooks.c (lhd_omp_predetermined_sharing): Return
> 	OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls.
> fortran/
> 	* trans-decl.c (saved_function_decls, saved_parent_function_decls):
> 	Remove unnecessary initialization.
> 	(create_function_arglist): Make sure __result has complete type.
> 	(gfc_get_fake_result_decl): Change current_fake_result_decl into
> 	a tree chain.  For entry master, create a separate variable
> 	for each result name.  For BT_CHARACTER results, call
> 	gfc_finish_var_decl on length even if it has been already created,
> 	but not pushdecl'ed.
> 	(gfc_trans_vla_type_sizes): For function/entry result, adjust
> 	result value type, not the FUNCTION_TYPE.
> 	(gfc_generate_function_code): Adjust for current_fake_result_decl
> 	changes.
> 	(gfc_trans_deferred_vars): Likewise.  Call gfc_trans_vla_type_sizes
> 	even on result if it is assumed-length character.
> 	* trans-openmp.c (gfc_omp_privatize_by_reference): Make
> 	DECL_ARTIFICIAL vars predetermined shared except GFC_DECL_RESULT.
> 	(gfc_omp_disregard_value_expr): Handle GFC_DECL_RESULT.
> 	(gfc_trans_omp_variable): New function.
> 	(gfc_trans_omp_variable_list, gfc_trans_omp_reduction_list): Use it.
> 	* trans.h (GFC_DECL_RESULT): Define.
> libgomp/
> 	* testsuite/libgomp.fortran/retval1.f90: New test.
> 	* testsuite/libgomp.fortran/vla7.f90: New test.
>
OK.



More information about the Fortran mailing list