public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/97272] New: Wrong answer from MAXLOC with character arg
@ 2020-10-02 14:03 longb at cray dot com
  2020-10-02 19:44 ` [Bug fortran/97272] " anlauf at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: longb at cray dot com @ 2020-10-02 14:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97272

            Bug ID: 97272
           Summary: Wrong answer from MAXLOC with character arg
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

Test case:

> cat test.f90
      program test
      character, allocatable :: a(:)
      integer(8) l, i
      l = 2000000_8
      allocate (a(l))
      do i = 1, l
      a(i) = 'a'
      end do
      l = l - 1
      a(l) = 'b'
      i = maxloc (a, dim=1, kind=8)
      print *, 'i = ', i, 'a(i) = ', a(i)
      end

Expected behavior (Cray):

> ftn test.f90
> ./a.out
 i =  1999999 a(i) = b

Incorrect result (gfortran):

> module swap PrgEnv-cray PrgEnv-gnu
> gfortran test.f90
> ./a.out
 i =               2000000 a(i) = a
> gfortran --version
GNU Fortran (GCC) 10.1.0 20200507 (Cray Inc.)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

end of thread, other threads:[~2021-01-22 21:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 14:03 [Bug fortran/97272] New: Wrong answer from MAXLOC with character arg longb at cray dot com
2020-10-02 19:44 ` [Bug fortran/97272] " anlauf at gcc dot gnu.org
2020-10-02 20:02 ` anlauf at gcc dot gnu.org
2020-10-02 20:32 ` anlauf at gcc dot gnu.org
2020-10-04 18:24 ` cvs-commit at gcc dot gnu.org
2020-10-04 21:53 ` longb at cray dot com
2020-10-05  7:16 ` anlauf at gcc dot gnu.org
2020-10-08 16:55 ` cvs-commit at gcc dot gnu.org
2020-10-08 20:29 ` cvs-commit at gcc dot gnu.org
2020-10-08 21:00 ` anlauf at gcc dot gnu.org
2021-01-22 21:08 ` longb at cray dot com
2021-01-22 21:24 ` anlauf at gcc dot gnu.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).