The following program is valid and compiles with GCC 4.2.x. However, using today's 4.3.0 it is rejected with the message: REAL, save :: c(0:(lmaxd+1)*(lmaxd+1)) 1 Error: automatic object 'c' at (1) cannot have the SAVE attribute Obviously, 'C' is not an automatic object but has constant bounds and can thus have the SAVE attribute. subroutine grylmr() integer, parameter :: lmaxd = 20 REAL, save :: c(0:(lmaxd+1)*(lmaxd+1)) end subroutine grylmr end
Fails: 2007-10-08-r129121 Works: 2007-09-27-r128828
works with revision 129038 (20071005).
Works: r129068; fails: r129069. http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00174.html r129069 | tobi | 2007-10-07 13:45:15 +0200 (So, 07 Okt 2007) | 14 lines PR 20851 fortran/ * expr.c (check_inquiry): Typo fix in error message. (check_init_expr): Same * 3. (check_restricted): Verify that no dummy arguments appear in restricted expressions in ELEMENTAL procedures. * resolve.c (resolve_fl_variable): Exchange order of checks to avoid side-effect.
Subject: Re: [Regression 4.3] Array with constant bound rejected as automatic array burnus at gcc dot gnu dot org wrote: > ------- Comment #3 from burnus at gcc dot gnu dot org 2007-10-08 17:58 ------- > Works: r129068; fails: r129069. > > http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00174.html > > r129069 | tobi | 2007-10-07 13:45:15 +0200 (So, 07 Okt 2007) | 14 lines > > PR 20851 > fortran/ > * expr.c (check_inquiry): Typo fix in error message. > (check_init_expr): Same * 3. > (check_restricted): Verify that no dummy arguments appear in > restricted expressions in ELEMENTAL procedures. > * resolve.c (resolve_fl_variable): Exchange order of checks to > avoid side-effect. > > Just great, looks like we were relying on a side-effect before. I'll have a look.
I think I have a fix. Needs some more testing, though.
Subject: Bug number PR33689 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00439.html
Subject: Bug 33689 Author: tobi Date: Mon Oct 8 20:54:47 2007 New Revision: 129139 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129139 Log: PR fortran/33689 fortran/ * resolve.c (gfc_resolve_expr): Fix indentation. (resolve_fl_variable_derived): Rename argument. (resolve_fl_variable): Fix case in message. Clarify logic. Correctly simplify array bounds. testsuite/ * gfortran.dg/spec_expr_5.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/spec_expr_5.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
Fixed.