program bug integer :: n real, dimension(2) ::& &a = (/ ( (float(n))**(1.0), n=1,2) /) write(*,*) a(1), a(2) stop end program bug gfortran-4.3 -S t.f90 t.f90: In function ‘bug’: t.f90:1: internal compiler error: in gfc_conv_array_initializer, at fortran/trans-array.c:3884 Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.opensuse.org/> for instructions.
Fails the same with 4.4, 4.2 reports an error: gfortran-4.2 -S t.f90 t.f90:4.35: &a = (/ ( (float(n))**(1.0), n=1,2) /) 1 Error: Exponent at (1) must be INTEGER for an initialization expression so I'm not sure if the testcase is valid or not.
(In reply to comment #1) > Fails the same with 4.4, 4.2 reports an error: > > gfortran-4.2 -S t.f90 > t.f90:4.35: > > &a = (/ ( (float(n))**(1.0), n=1,2) /) > 1 > Error: Exponent at (1) must be INTEGER for an initialization expression > > so I'm not sure if the testcase is valid or not. > It is invalid in Fortran 95, and the error message is correct. It is valid in Fortran 2003. The patch in http://gcc.gnu.org/ml/fortran/2009-01/msg00231.html may fix your problem.
Steve, > The patch in > http://gcc.gnu.org/ml/fortran/2009-01/msg00231.html > may fix your problem. > It does - you are right! I'll post a response to your patch that it should be applied to 4.4 to fix this regression. Thanks Paul
(In reply to comment #3) > Steve, > > > The patch in > > http://gcc.gnu.org/ml/fortran/2009-01/msg00231.html > > may fix your problem. > > > > It does - you are right! I'll post a response to your patch that it should be > applied to 4.4 to fix this regression. > > Thanks > > Paul > At this stage in the 4.4 release process, I think my patch is too risky. I've only done some limited testing. This should probably be considered a 4.5 patch.
Steve, > > At this stage in the 4.4 release process, I think my patch is too risky. > I've only done some limited testing. This should probably be considered > a 4.5 patch. > Should I apply mine, with a check that the expression is constant? Paul
Subject: Bug 39292 Author: pault Date: Thu Feb 26 06:23:42 2009 New Revision: 144444 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144444 Log: 2009-02-26 Paul Thomas <pault@gcc.gnu.org> PR fortran/39292 * trans-array.c (gfc_conv_array_initializer): Convert all expressions rather than ICEing. 2009-02-26 Paul Thomas <pault@gcc.gnu.org> PR fortran/39292 * gfortran.dg/initialization_22.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/initialization_22.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c trunk/gcc/testsuite/ChangeLog
Fixed on trunk. Thanks for the report, Richard Paul
Not fixed on the branch. If you don't want to fix it there please adjust the target milestone appropriately.
(In reply to comment #8) > Not fixed on the branch. If you don't want to fix it there please adjust > the target milestone appropriately. > Duuuh! No, that's fine. I'll give it a few days on trunk and then fix it on 4.3. Cheers Paul
Subject: Bug 39292 Author: pault Date: Sat Mar 7 15:56:37 2009 New Revision: 144694 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144694 Log: 2009-03-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/39292 * trans-array.c (gfc_conv_array_initializer): Convert all expressions rather than ICEing. 2009-03-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/39292 * gfortran.dg/initialization_22.f90: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/initialization_22.f90 Modified: branches/gcc-4_3-branch/gcc/fortran/ChangeLog branches/gcc-4_3-branch/gcc/fortran/trans-array.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed on trunk and 4.3. Thanks for the report. Paul