[Bug fortran/85534] allocation of array with source give shifted index

2018-10-17 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85534

Tobias Burnus  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||burnus at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from Tobias Burnus  ---
I believe it has been FIXED by the patch for PR 67125.

[Bug fortran/85534] allocation of array with source give shifted index

2018-07-08 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85534

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||simon.kluepfel at gmail dot com

--- Comment #2 from Dominique d'Humieres  ---
*** Bug 86262 has been marked as a duplicate of this bug. ***

[Bug fortran/85534] allocation of array with source give shifted index

2018-04-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85534

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-04-26
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed from 6.4 up to trunk (9.0). Reduced test case

module test
contains
 function w2at(word) result(asciitable)
  character(len=*), intent(in) :: word
  integer, dimension(:), allocatable :: asciitable
  integer :: i

  allocate(asciitable(len(word)))
  forall(i=1:len(word)) asciitable(i) = iachar(word(i:i))

 end function w2at
end module test

program tst

use test
implicit none
character(len=256) :: word1
integer, dimension(:), allocatable :: aword1, help

word1="*STEP"
allocate(help,source=w2at(word1))
print *, "lbound of help = ", lbound(help)
print *, "lbound of pack = ", lbound(pack(help,help/=32))
allocate(aword1,source=pack(help,help/=32))
print *, "lbound of aword1 = ", lbound(aword1)

end program

which gives

 lbound of help =1
 lbound of pack =1
 lbound of aword1 =0