diff options
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 86c3d3a..2a9b852 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -753,6 +753,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); + TREE_STATIC (decl) = 1; /* Because the size of this variable isn't known until now, we may have |