Bug 33513 - error reported on correct initialization code.
Summary: error reported on correct initialization code.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.2
: P3 major
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-21 02:57 UTC by Norman S. Clerman
Modified: 2007-09-23 09:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman S. Clerman 2007-09-21 02:57:43 UTC
I get the following error message:

mtftypesM.f90:615.71:

  real (DOUB_PREC), parameter :: DEFAULT_MTF_FIELDS(2, MTF_FIELD_PTS) = &
                                                                      1
Error: Extension: Evaluation of nonstandard initialization expression at (1)
mtftypesM.f90:441.52:

on the following line of code:

  real (DOUB_PREC), parameter :: DEFAULT_MTF_FIELDS(2, MTF_FIELD_PTS) = &
    & reshape ((/0.0_DOUB_PREC, 0.0_DOUB_PREC, 0.0_DOUB_PREC, 0.35_DOUB_PREC, 0.0_DOUB_PREC, 0.7_DOUB_PREC,&
    & 0.0_DOUB_PREC, 0.85_DOUB_PREC, 0.0_DOUB_PREC, 1.0_DOUB_PREC/), shape = (/2_TinyInteger, MTF_FIELD_PTS/))

where

  integer, parameter :: DefaultInteger = kind (1)
  integer(DefaultInteger), parameter :: TinyInteger = selected_int_kind (2)
  integer(DefaultInteger), parameter :: DOUB_PREC = selected_real_kind (15, 307)
  integer (TinyInteger), parameter ::  MTF_FIELD_PTS = 5_TinyInteger

  I believe this may be the same as bug 29962. Note that the following compilers all correctly compile this code: Lahey LF64, NAG version 5.1, Intel version 10, g95.

Norm Clerman
Comment 1 kargls 2007-09-21 03:46:13 UTC
What compiler options did you use?
Can you provide a self contained example?
Comment 2 Tobias Burnus 2007-09-21 07:58:12 UTC
I can reproduce the problem with gfortran 4.1 and 4.2 with -std=f95/-std=f2003; however, gfortran 4.3.0 compiles this program with -std=f95 without showing this error.

I therefore suggest you to either don't use -std=f95 or -std=f2003 for this file or to use the 4.3.0 compiler of gfortran, available from, e.g.,
http://gcc.gnu.org/wiki/GFortranBinaries

As this bug is no regression, does not generate wrong code and can easily be worked around by not using -std=f*, we will not backport the fixes to GCC 4.2.x or even 4.1.x. (Last but not least in order to not inadvertently induce regressions.)

It would be nice, if you could confirm that the error is indeed fixed in GCC 4.3.0.

Thanks for reporting the bug.
Comment 3 Norman S. Clerman 2007-09-22 16:37:22 UTC
Subject: Re:  error reported on correct initialization
 code.

burnus,

    Thank you for your very prompt reply. I tried version 4.3.0; the bug 
does not exist in it.

    Using this version I have located a new bug that I have reported. 
It's bug 33529.

    Thanks for your attention.

Norm Clerman


burnus at gcc dot gnu dot org wrote:
> ------- Comment #2 from burnus at gcc dot gnu dot org  2007-09-21 07:58 -------
> I can reproduce the problem with gfortran 4.1 and 4.2 with -std=f95/-std=f2003;
> however, gfortran 4.3.0 compiles this program with -std=f95 without showing
> this error.
>
> I therefore suggest you to either don't use -std=f95 or -std=f2003 for this
> file or to use the 4.3.0 compiler of gfortran, available from, e.g.,
> http://gcc.gnu.org/wiki/GFortranBinaries
>
> As this bug is no regression, does not generate wrong code and can easily be
> worked around by not using -std=f*, we will not backport the fixes to GCC 4.2.x
> or even 4.1.x. (Last but not least in order to not inadvertently induce
> regressions.)
>
> It would be nice, if you could confirm that the error is indeed fixed in GCC
> 4.3.0.
>
> Thanks for reporting the bug.
>
>
>   
Comment 4 Norman S. Clerman 2007-09-22 16:37:25 UTC
Subject: Re:  error reported on correct initialization
 code.

kargl,

    Thanks for your very prompt reply. burnus also replied to my bug 
suggesting I try version 4.3.0. I did that, and the bug is not present.

    Using this version I have located a new bug that I have reported. 
It's bug 33529.

    Thanks for your attention.

Norm Clerman

kargl at gcc dot gnu dot org wrote:
> ------- Comment #1 from kargl at gcc dot gnu dot org  2007-09-21 03:46 -------
> What compiler options did you use?
> Can you provide a self contained example?
>
>
>   
Comment 5 Francois-Xavier Coudert 2007-09-23 09:08:46 UTC
Fixed on 4.3.