https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98411
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:1e9e0798d2242b7908db4098136d0bfd0bc7f0e8 commit r11-8480-g1e9e0798d2242b7908db4098136d0bfd0bc7f0e8 Author: Harald Anlauf <anl...@gmx.de> Date: Mon May 17 21:35:38 2021 +0200 PR fortran/98411 - Pointless warning for static variables Variables with explicit SAVE attribute cannot end up on the stack. There is no point in checking whether they should be moved off the stack to static storage. gcc/fortran/ChangeLog: PR fortran/98411 * trans-decl.c (gfc_finish_var_decl): Add check for explicit SAVE attribute. gcc/testsuite/ChangeLog: PR fortran/98411 * gfortran.dg/pr98411.f90: New test. (cherry picked from commit 09867aa0ef7568012650395189b735f9a34cf9b5)