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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-03-28
                 CC|                            |janus at gcc dot gnu.org
      Known to work|                            |5.5.0, 6.5.0, 7.3.0, 9.0
             Blocks|                            |39627
            Summary|POINTER                     |[8 Regression] [F08]
                   |                            |wrong-code problem with
                   |                            |POINTER, INTENT(IN)
                   |                            |argument
     Ever confirmed|0                           |1
      Known to fail|                            |8.2.0

--- Comment #2 from janus at gcc dot gnu.org ---
I can confirm this problem. Reduced test case:


PROGRAM testfortran2
  IMPLICIT NONE

  INTEGER, DIMENSION(10), TARGET :: i4array

  i4array = (/ 1,2,3,4,5,6,7,8,9,10 /)

  call InRef(i4array)

CONTAINS

  subroutine InRef(v)
    INTEGER, DIMENSION(:), POINTER, INTENT(in) :: v
    INTEGER :: i
    DO i=1, SIZE(v,1)
      WRITE(*,*) v(i)
    END DO
  END subroutine

END


This gives the correct output with all gfortran versions I tried (including
trunk and 7.3), except 8.2, which prints:

           1
           1
           1
           1
           1
           1
           1
           1
           1
           1

Note that the test case is invalid in Fortran 2003:

    8 |   call InRef(i4array)
      |             1
Error: Fortran 2008: Non-pointer actual argument at (1) to pointer dummy ā€˜v’


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39627
[Bug 39627] [meta-bug] Fortran 2008 support

Reply via email to