This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33354] New: MINLOC in combination with SUM gives wrong result
- From: "enok at lysator dot liu dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Sep 2007 13:02:44 -0000
- Subject: [Bug fortran/33354] New: MINLOC in combination with SUM gives wrong result
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
A simple program should print "1" but prints "2". Of some reason MINLOC fails
to find the minium location (first location) for the SUM expression.
PROGRAM TST
IMPLICIT NONE
REAL :: A(1,3)
A(:,1) = 10
A(:,2) = 20
A(:,3) = 30
WRITE(*,*) SUM(A(:,1:3),1)
WRITE(*,*) MINLOC(SUM(A(:,1:3),1),1)
END PROGRAM TST
bash%> gfortran -o tst tst.f90
bash%> ./tst
10.00000 20.00000 30.00000
2
bash%>
--
Summary: MINLOC in combination with SUM gives wrong result
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: enok at lysator dot liu dot se
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33354