public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35994]  New: MAXLOC and MINLOC off by one with mask
@ 2008-04-20 20:31 dick dot hendrickson at gmail dot com
  2008-04-20 20:51 ` [Bug fortran/35994] " tkoenig at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-04-20 20:31 UTC (permalink / raw)
  To: gcc-bugs

The MAXLOC and MINLOC functions give an off by one wrong
answer when there is a mask argument.

Dick Hendrickson

      program GA4076

! fails on Windows XP
! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139]

      REAL DDA(100)
      dda = (/(J1,J1=1,100)/)

      IDS = MAXLOC(DDA,1)
      print *, 1, ids, ids.eq.100         !expect 100

      IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
      print *, 2, ids, ids.eq.100         !expect 100

      IDS = minLOC(DDA,1)
      print *, 3, ids, ids.eq.1           !expect 1

      IDS = MinLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
      print *, 4, ids, ids.eq.51          !expect 51

      END 

C:\gfortran:gfortran ga4076.f

C:\gfortran:a
           1         100 T
           2         101 F
           3           1 T
           4          52 F


-- 
           Summary: MAXLOC and MINLOC off by one with mask
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35994


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-04-26 15:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-20 20:31 [Bug fortran/35994] New: MAXLOC and MINLOC off by one with mask dick dot hendrickson at gmail dot com
2008-04-20 20:51 ` [Bug fortran/35994] " tkoenig at gcc dot gnu dot org
2008-04-22 18:43 ` [Bug fortran/35994] [4.3/4.4 regression] " tkoenig at gcc dot gnu dot org
2008-04-22 18:58 ` tkoenig at gcc dot gnu dot org
2008-04-22 19:35 ` jakub at gcc dot gnu dot org
2008-04-22 22:35 ` pault at gcc dot gnu dot org
2008-04-23  8:12 ` fxcoudert at gcc dot gnu dot org
2008-04-24  2:05 ` jvdelisle at gcc dot gnu dot org
2008-04-24  3:49 ` jvdelisle at gcc dot gnu dot org
2008-04-24  3:50 ` jvdelisle at gcc dot gnu dot org
2008-04-24  3:56 ` jvdelisle at gcc dot gnu dot org
2008-04-26 15:34 ` jvdelisle at gcc dot gnu dot org
2008-04-26 15:36 ` jvdelisle at gcc dot gnu dot org
2008-04-26 15:37 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).