[Bug fortran/33354] New: MINLOC in combination with SUM gives wrong result
enok at lysator dot liu dot se
gcc-bugzilla@gcc.gnu.org
Sat Sep 8 13:02:00 GMT 2007
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
More information about the Gcc-bugs
mailing list