re PR fortran/42517 (-fcheck=recursion does not work with -fopenmp)
authorTobias Burnus <burnus@net-b.de>
Tue, 5 Jan 2010 14:15:37 +0000 (15:15 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 5 Jan 2010 14:15:37 +0000 (15:15 +0100)
2010-01-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42517
        * options.c (gfc_post_options): Set -frecursion
        when -fopenmp is used.

From-SVN: r155649

gcc/fortran/ChangeLog
gcc/fortran/options.c

index 6a594255dfe49d262443860bb9a42767e9bc370f..7de1ba76ba32adb672556c4de031d7a9864a5ad4 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-05  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/42517
+       * options.c (gfc_post_options): Set -frecursion
+       when -fopenmp is used.
+
 2010-01-05  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/41872
index 43c44db09115727d4104882a37b4ebc4919a6ce8..9296a0be66769d4c5b6040e137cefb015dd9dbe3 100644 (file)
@@ -353,18 +353,22 @@ gfc_post_options (const char **pfilename)
                     "implied by -fopenmp", 
                     gfc_option.flag_max_stack_var_size);
 
-  /* Implied -frecursive; implemented as -fmax-stack-var-size=-1.  */
-  if (gfc_option.flag_max_stack_var_size == -2 && gfc_option.flag_openmp)
+  /* Implement -frecursive as -fmax-stack-var-size=-1.  */
+  if (gfc_option.flag_recursive)
     gfc_option.flag_max_stack_var_size = -1;
 
+  /* Implied -frecursive; implemented as -fmax-stack-var-size=-1.  */
+  if (gfc_option.flag_max_stack_var_size == -2 && gfc_option.flag_openmp
+      && gfc_option.flag_automatic)
+    {
+      gfc_option.flag_recursive = 1;
+      gfc_option.flag_max_stack_var_size = -1;
+    }
+
   /* Set default.  */
   if (gfc_option.flag_max_stack_var_size == -2)
     gfc_option.flag_max_stack_var_size = 32768;
 
-  /* Implement -frecursive as -fmax-stack-var-size=-1.  */
-  if (gfc_option.flag_recursive)
-    gfc_option.flag_max_stack_var_size = -1;
-
   /* Implement -fno-automatic as -fmax-stack-var-size=0.  */
   if (!gfc_option.flag_automatic)
     gfc_option.flag_max_stack_var_size = 0;