------- Comment #1 from janus at gcc dot gnu dot org  2009-12-27 18:39 -------
An easy way to fix this is to simply disable the recursion check if -fopenmp is
given:

Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 155479)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -4318,7 +4318,8 @@ gfc_generate_function_code (gfc_namespace * ns)
    is_recursive = sym->attr.recursive
                  || (sym->attr.entry_master
                      && sym->ns->entries->sym->attr.recursive);
-   if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive)
+   if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive
+       && !gfc_option.flag_openmp)
      {
        char * msg;

@@ -4395,7 +4396,8 @@ gfc_generate_function_code (gfc_namespace * ns)
       gfc_add_expr_to_block (&block, tmp);

       /* Reset recursion-check variable.  */
-      if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive)
+      if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive
+         && !gfc_option.flag_openmp)
        {
          gfc_add_modify (&block, recurcheckvar, boolean_false_node);
          recurcheckvar = NULL;
@@ -4426,7 +4428,8 @@ gfc_generate_function_code (gfc_namespace * ns)
     {
       gfc_add_expr_to_block (&block, tmp);
       /* Reset recursion-check variable.  */
-      if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive)
+      if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive
+         && !gfc_option.flag_openmp)
       {
        gfc_add_modify (&block, recurcheckvar, boolean_false_node);
        recurcheckvar = NULL;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42517

Reply via email to