From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25871 invoked by alias); 3 Jul 2009 19:30:25 -0000 Received: (qmail 25522 invoked by uid 48); 3 Jul 2009 19:30:05 -0000 Date: Fri, 03 Jul 2009 19:30:00 -0000 Message-ID: <20090703193005.25521.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40643] maxloc/minloc: Wrong result for NaN at position 1 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" 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: 2009-07/txt/msg00285.txt.bz2 ------- Comment #1 from jakub at gcc dot gnu dot org 2009-07-03 19:30 ------- Even the inline version is wrong I think. real :: r(4), z z = 0.0 r = (/ z/z, z/z, z/z, z/z /) print *,r print *, minloc(r,dim=1), minval(r,dim=1) print *, maxloc(r,dim=1), maxval(r,dim=1) end Not sure what minval/maxval should be in this case, but minloc/maxloc 0 looks wrong (given that for non-empty arrays it is supposed to be 1 .. arrayextent). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40643