The following code fails [/Users/fca] more test.f subroutine test(bbb) implicit double precision (A-H,O-Z) double precision blob(100),bbb(100) data blob /100*-1/ save blob do j=1,100 blob(j)=bbb(j) enddo end [/Users/fca] /opt/gcc-4_0/bin/gfortran -c -fno-automatic test.f In file test.f:3 double precision blob(100),bbb(100) 1 Error: Duplicate SAVE attribute specified at (1) Two remarks. - Non-contraddictory declarations should not cause compilation to fail (see with double precision) - A compiler switch should not turn valid code into non-compilable code
I have the same problem (g77 does not complain) - [dranta:~/tests/gfortran-D] dir% g77 -c -fno-automatic save.f [dranta:~/tests/gfortran-D] dir% gfortran -c -fno-automatic save.f In file save.f:2 save lastcol 1 Error: Duplicate SAVE attribute specified at (1) [dranta:~/tests/gfortran-D] dir% cat save.f subroutine gdpstc(ifxn,xa,ya) save lastcol return end [dranta:~/tests/gfortran-D] dir% gfortran --v Using built-in specs. Target: powerpc-apple-darwin7.9.0 Configured with: ./configure --prefix=/Users/dir/gfortran --enable-languages=c,f95 Thread model: posix gcc version 4.1.0 20050906 (experimental)
-fno-automatic should be a synonym for -fmax-stack-var-size=0 instead of what is implemented now.
Subject: Bug 23677 CVSROOT: /cvs/gcc Module name: gcc Changes by: jakub@gcc.gnu.org 2005-09-26 20:06:37 Modified files: gcc/fortran : ChangeLog gcc/testsuite : ChangeLog gcc/fortran : options.c symbol.c resolve.c Added files: gcc/testsuite/gfortran.dg: save_1.f90 gcc/testsuite/gfortran.fortran-torture/execute: save_1.f90 Log message: PR fortran/23677 * symbol.c (gfc_is_var_automatic): Return true if character length is non-constant rather than constant. * resolve.c (gfc_resolve): Don't handle !gfc_option.flag_automatic here. * options.c (gfc_post_options): Set gfc_option.flag_max_stack_var_size to 0 for -fno-automatic. * gfortran.fortran-torture/execute/save_1.f90: New test. * gfortran.dg/save_1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.568&r2=1.569 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6105&r2=1.6106 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/options.c.diff?cvsroot=gcc&r1=1.25&r2=1.26 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&r1=1.34&r2=1.35 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.55&r2=1.56 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/save_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 23677 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: jakub@gcc.gnu.org 2005-09-29 21:27:35 Modified files: gcc/fortran : ChangeLog gcc/testsuite : ChangeLog gcc/fortran : symbol.c options.c resolve.c Added files: gcc/testsuite/gfortran.dg: save_1.f90 gcc/testsuite/gfortran.fortran-torture/execute: save_1.f90 Log message: PR fortran/23677 * symbol.c (gfc_is_var_automatic): Return true if character length is non-constant rather than constant. * resolve.c (gfc_resolve): Don't handle !gfc_option.flag_automatic here. * options.c (gfc_post_options): Set gfc_option.flag_max_stack_var_size to 0 for -fno-automatic. * gfortran.fortran-torture/execute/save_1.f90: New test. * gfortran.dg/save_1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.121&r2=1.335.2.122 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.416&r2=1.5084.2.417 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.26.2.3&r2=1.26.2.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/options.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.17.8.5&r2=1.17.8.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34.2.15&r2=1.34.2.16 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/save_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1
Fixed.