aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2019-11-10 23:25:25 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2019-11-10 23:25:25 +0200
commit15471d58fe2e8349c391205338176f3fbdaad70c (patch)
tree3ce322b6f55a8520fd1806acbff3746716cbafcb
parent2806ecbdc8054ef9f3968577806b007baefad4e6 (diff)
downloadgcc-15471d58fe2e8349c391205338176f3fbdaad70c.zip
gcc-15471d58fe2e8349c391205338176f3fbdaad70c.tar.gz
gcc-15471d58fe2e8349c391205338176f3fbdaad70c.tar.bz2
Don't print warning when moving to static with -fno-automatic
As part of PR 91413, GFortran now prints a warning when a variable is moved from the stack to static storage. However, when the user explicitly specifies that all local variables should be put in static storage with the -fno-automatic option, don't print this warning. Regtested on x86_64-pc-linux-gnu, committed as obvious. gcc/fortran/ChangeLog: 2019-11-10 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/91413 * trans-decl.c (gfc_finish_var_decl): Don't print warning when -fno-automatic is enabled. From-SVN: r278027
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c19
2 files changed, 16 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 33e0f18..2031688 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-10 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/91413
+ * trans-decl.c (gfc_finish_var_decl): Don't print warning when
+ -fno-automatic is enabled.
+
2019-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92123
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ffa6111..76e1c7a 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -746,15 +746,16 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
|| sym->attr.allocatable)
&& !DECL_ARTIFICIAL (decl))
{
- gfc_warning (OPT_Wsurprising,
- "Array %qs at %L is larger than limit set by"
- " %<-fmax-stack-var-size=%>, moved from stack to static"
- " storage. This makes the procedure unsafe when called"
- " recursively, or concurrently from multiple threads."
- " Consider using %<-frecursive%>, or increase the"
- " %<-fmax-stack-var-size=%> limit, or change the code to"
- " use an ALLOCATABLE array.",
- sym->name, &sym->declared_at);
+ if (flag_max_stack_var_size > 0)
+ gfc_warning (OPT_Wsurprising,
+ "Array %qs at %L is larger than limit set by"
+ " %<-fmax-stack-var-size=%>, moved from stack to static"
+ " storage. This makes the procedure unsafe when called"
+ " recursively, or concurrently from multiple threads."
+ " Consider using %<-frecursive%>, or increase the"
+ " %<-fmax-stack-var-size=%> limit, or change the code to"
+ " use an ALLOCATABLE array.",
+ sym->name, &sym->declared_at);
TREE_STATIC (decl) = 1;