diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-11-30 15:27:44 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-11-30 15:27:44 +0100 |
commit | f4e7ea81d1369d4d6cb6d8e440aefb3407142e05 (patch) | |
tree | 4f8d38858a78db5b1288637ff4807290bee08bda /gcc/fortran/options.c | |
parent | 2610c786f7496c5006bb68d6801ef7450bd231a9 (diff) | |
download | gcc-f4e7ea81d1369d4d6cb6d8e440aefb3407142e05.zip gcc-f4e7ea81d1369d4d6cb6d8e440aefb3407142e05.tar.gz gcc-f4e7ea81d1369d4d6cb6d8e440aefb3407142e05.tar.bz2 |
Fortran: -fno-automatic and -fopenacc / recusion check cleanup
Options: -fopenmp and -fopenacc imply concurrent calls to a
procedure; now also -fopenacc implies -frecursive, disabling
that larger local const-size array variables use static memory.
Run-time recursion check: Always reset the check variable at the
end of the procedure; this avoids a bogus error with -fopenmp
when called twice nonconcurrently/nonrecursively. (Issue requires
using -fno-automatic or -fmax-stack-var-size= to trigger.)
gcc/fortran/ChangeLog:
PR fortran/98010
PR fortran/98013
* options.c (gfc_post_options): Also imply recursive with
-fopenacc.
* trans-decl.c (gfc_generate_function_code): Simplify condition.
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r-- | gcc/fortran/options.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index d844fa9..66be1d5 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -412,22 +412,24 @@ gfc_post_options (const char **pfilename) else if (!flag_automatic && flag_recursive) gfc_warning_now (OPT_Woverwrite_recursive, "Flag %<-fno-automatic%> " "overwrites %<-frecursive%>"); - else if (!flag_automatic && flag_openmp) - gfc_warning_now (0, "Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by " - "%<-fopenmp%>"); + else if (!flag_automatic && (flag_openmp || flag_openacc)) + gfc_warning_now (0, "Flag %<-fno-automatic%> overwrites %<-frecursive%> " + "implied by %qs", flag_openmp ? "-fopenmp" : "-fopenacc"); else if (flag_max_stack_var_size != -2 && flag_recursive) gfc_warning_now (0, "Flag %<-frecursive%> overwrites %<-fmax-stack-var-size=%d%>", flag_max_stack_var_size); - else if (flag_max_stack_var_size != -2 && flag_openmp) - gfc_warning_now (0, "Flag %<-fmax-stack-var-size=%d%> overwrites %<-frecursive%> " - "implied by %<-fopenmp%>", flag_max_stack_var_size); + else if (flag_max_stack_var_size != -2 && (flag_openmp || flag_openacc)) + gfc_warning_now (0, "Flag %<-fmax-stack-var-size=%d%> overwrites " + "%<-frecursive%> implied by %qs", flag_max_stack_var_size, + flag_openmp ? "-fopenmp" : "-fopenacc"); /* Implement -frecursive as -fmax-stack-var-size=-1. */ if (flag_recursive) flag_max_stack_var_size = -1; /* Implied -frecursive; implemented as -fmax-stack-var-size=-1. */ - if (flag_max_stack_var_size == -2 && flag_openmp && flag_automatic) + if (flag_max_stack_var_size == -2 && flag_automatic + && (flag_openmp || flag_openacc)) { flag_recursive = 1; flag_max_stack_var_size = -1; |