This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32298] MINLOC / MAXLOC: off-by one for PARAMETER arrays
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2007 16:05:26 -0000
- Subject: [Bug fortran/32298] MINLOC / MAXLOC: off-by one for PARAMETER arrays
- References: <bug-32298-14685@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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 <A.2[S.3] - D.1367> < limit.1 || pos.0 == 0)
+ if (ABS_EXPR <a[S.3 + -1] - D.1367> < limit.1 || pos.0 ==
0)
{
- limit.1 = ABS_EXPR <A.2[S.3] - D.1367>;
+ limit.1 = ABS_EXPR <a[S.3 + -1] - D.1367>;
- 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