On a 64-bit Ubuntu 6.10 system with gcc-4.2-20070228, gfortran erroneously gives an error for good F90 code. In the code two parameter arrays are defined then one is multiplied by a section of the other, with the section selected with non-unit stride. An error is generated referencing the declaration of the sectioned array. It looks like the array section is not being generated properly, but simply writing the array section to stdout produces the expected output.
The error is not produced if either of the arrays are not parameters, or the array section is unit stride. gfortran from Ubuntu's gcc-4.1.2 gives the same error. [EMAIL PROTECTED] VielPotential]$ cat bugtest.f90 program PotentialMatrix implicit none real(kind=8),dimension(2),parameter::v2=(/1,2/) real(kind=8),dimension(4),parameter::v4=(/1,2,3,4/) write(*,*)v2*v4(1:3:2) end [EMAIL PROTECTED] VielPotential]$ gfortran -v -g -o bugtest bugtest.f90 Driving: gfortran -v -g -o bugtest bugtest.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ./configure --disable-multilib --enable-languages=fortran Thread model: posix gcc version 4.2.0 20070228 (prerelease) /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/f951 bugtest.f90 -quiet -dumpbase bugtest.f90 -mtune=generic -auxbase bugtest -g -version -I /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/finclude -o /tmp/cc5EhKbq.s GNU F95 version 4.2.0 20070228 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.2.0 20070228 (prerelease). GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=112046 bugtest.f90:3.40: real(kind=8),dimension(2),parameter::v2=(/1,2/) 1 Error: different shape for Elemental binary operation at (1) on dimension 1 (2/1) bugtest.f90:3.40: real(kind=8),dimension(2),parameter::v2=(/1,2/) 1 Error: Array operands are incommensurate at (1) [EMAIL PROTECTED] VielPotential]$ -- Summary: Incorrect error: parameter array sections Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: terry at chem dot gu dot se GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31011