From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19842 invoked by alias); 12 Jun 2007 16:05:40 -0000 Received: (qmail 19513 invoked by uid 48); 12 Jun 2007 16:05:26 -0000 Date: Tue, 12 Jun 2007 16:05:00 -0000 Message-ID: <20070612160526.19512.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/32298] MINLOC / MAXLOC: off-by one for PARAMETER arrays In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus 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: 2007-06/txt/msg00914.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2007-06-12 16:05 ------- The result is ok, if one removes PARAMETER. If one looks at the dump one find the following difference between arrays which are parameters and those which are variables: - S.3 = 0; + S.3 = 1; while (1) { - if (S.3 > 6) goto L.3; + if (S.3 > 7) goto L.3; - if (ABS_EXPR < limit.1 || pos.0 == 0) + if (ABS_EXPR < limit.1 || pos.0 == 0) { - limit.1 = ABS_EXPR ; + limit.1 = ABS_EXPR ; - pos.0 = S.3; + pos.0 = S.3; (This might also affect MAXVAL/MINVAL, though I did not manage to cook up an example.) -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2007-06-12 16:05:26 date| | Summary|Intrinsic MINLOC / MAXLOC |MINLOC / MAXLOC: off-by one |gives wrong results |for PARAMETER arrays |(gfortran build 20070522) | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32298