public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31011]  New: Incorrect error: parameter array sections
@ 2007-03-01 16:50 terry at chem dot gu dot se
  2007-03-01 18:02 ` [Bug fortran/31011] " burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: terry at chem dot gu dot se @ 2007-03-01 16:50 UTC (permalink / raw)
  To: gcc-bugs

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.


[tjf@fkpc167 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

[tjf@fkpc167 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)
[tjf@fkpc167 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-27  9:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-01 16:50 [Bug fortran/31011] New: Incorrect error: parameter array sections terry at chem dot gu dot se
2007-03-01 18:02 ` [Bug fortran/31011] " burnus at gcc dot gnu dot org
2007-03-07  9:41 ` pault at gcc dot gnu dot org
2007-03-08  6:25 ` patchapp at dberlin dot org
2007-03-08  9:10 ` pault at gcc dot gnu dot org
2007-03-27  9:02 ` [Bug fortran/31011] [4.2 and 4.1 only] " pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).