From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27750 invoked by alias); 8 Sep 2007 13:02:59 -0000 Received: (qmail 27720 invoked by uid 48); 8 Sep 2007 13:02:44 -0000 Date: Sat, 08 Sep 2007 13:02:00 -0000 Subject: [Bug fortran/33354] New: MINLOC in combination with SUM gives wrong result X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "enok at lysator dot liu dot se" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-09/txt/msg00666.txt.bz2 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