------- 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

Reply via email to