public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99027] New: Incorrect ubound result
@ 2021-02-09 15:30 andrew.burgess at embecosm dot com
  2021-02-13 11:59 ` [Bug fortran/99027] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: andrew.burgess at embecosm dot com @ 2021-02-09 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99027
           Summary: Incorrect ubound result
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrew.burgess at embecosm dot com
  Target Milestone: ---

I believe I have run into a case where ubound is giving the wrong result.

Given:

  program test
    integer, dimension (1:3,1:6) :: array
    print *, "ubound = ", ubound (array (1, 1:4))
  end program test

I see the output:

  ubound =            1

When I would have expected:

  ubound =            4

Due to array (1, 1:4) being a 4 element 1-dimensional array.

I am seeing this behaviour in my default Fedora compiler:

  GNU Fortran (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

But I also build current HEAD from git (26a3f288f18) and am still seeing this
issue:

  GNU Fortran (GCC) 11.0.0 20210209 (experimental)

Interestingly, if I change the test program to:

  program test
    integer, dimension (1:3,1:6) :: array
    print *, "ubound = ", ubound (array (1:2, 1:4))
  end program test

Then I do now see what I would expect for this case:

  ubound =            2           4

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

end of thread, other threads:[~2021-02-22 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 15:30 [Bug fortran/99027] New: Incorrect ubound result andrew.burgess at embecosm dot com
2021-02-13 11:59 ` [Bug fortran/99027] " dominiq at lps dot ens.fr
2021-02-13 19:42 ` burnus at gcc dot gnu.org
2021-02-19  9:42 ` cvs-commit at gcc dot gnu.org
2021-02-20 20:04 ` andrew.burgess at embecosm dot com
2021-02-22 10:31 ` cvs-commit at gcc dot gnu.org
2021-02-22 10:48 ` burnus 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).