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: PR fortran/42517: -fcheck=recursion does not work with -fopenmp


Hi,

One gfc_option.flag_openmp check is missing, which leads to

/export/gnu/import/svn/gcc-test/src-trunk/libgomp/testsuite/libgomp.fortran/recursion1.f90
Fortran runtime error: Recursive call to nonrecursive procedure 'sub'

OK for trunk?

Thanks.


H.J.
---
2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>
 
	PR fortran/42517
	* trans-decl.c (gfc_generate_function_code): Disable
	-fcheck=recursion when used with -fopenmp.

diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ce33b2a..e9178f1 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4322,7 +4322,7 @@ gfc_generate_function_code (gfc_namespace * ns)
 		  || (sym->attr.entry_master
 		      && sym->ns->entries->sym->attr.recursive);
    if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive
-       && !gfc_option.flag_recursive)
+       && !gfc_option.flag_recursive && !gfc_option.flag_openmp)
      {
        char * msg;
 


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