Patch for MAX_MINLOC

Feng Wang wf_cs@yahoo.com
Fri Oct 17 09:28:00 GMT 2003


  Thanks for Joost VandeVondele and Vijayendra
Munikoti. These are their test programs:
  REAL A(-1:1) ,B(2:3),C(1:2)
  A=0
  B=0
  C=0
  A(-1)=1
  B(2)=1
  C(1)=1
  ! maxloc should be an integer i.e. write(6,*)
MAXLOC(C,1)
  IF (MAXLOC(A,1).NE.1) CALL ABORT()
  IF (MAXLOC(B,1).NE.1) CALL ABORT()
  IF (MAXLOC(C,1).NE.1) CALL ABORT()
  END

And:
PROGRAM TEST
INTEGER (KIND = 4), DIMENSION(1):: I
REAL (KIND = 8), DIMENSION(3) :: VC
VC = (/4.0D0, 2.50D1, 1.0D1/)
I = MINLOC(VC)
PRINT*, I
END PROGRAM TEST

  The Changlog entry of gcc/gcc/fortran:

2003-10-17  Feng Wang  <wf_cs@yahoo.com>
    * iresolve.c (gfc_resolve_maxloc): Change the
result's kind and type.
    (gfc_resolve_minloc): Ditto.
    * trans-intrinsic.c
(gfc_conv_intrinsic_minmaxloc): Fix bugs about type. 

  Paul, can you check the diff file attached ? The
main changes are about the type and kind of the array
returned.

  Feng Wang




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: maxminloc.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20031017/364df1f3/attachment.ksh>


More information about the Fortran mailing list